From 3bc818f6e4c56d04a8774a3685af220d69d9f2d6 Mon Sep 17 00:00:00 2001 From: Xavi Date: Sun, 21 Mar 2010 19:32:50 +0000 Subject: [PATCH] 2010-03-21 20:30 UTC+0100 Xavi (jarabal/at/gmail.com) * harbour/src/rtl/teditor.prg ! Fixing MemoEdit parameter calculation: nTextBuffRow, nWindowColumn. Procedure Main() Cls // Put 5 in the 5 position and next BS to change. ? MemoEdit( "123",,, MaxRow(), MaxCol(),,,,,, 5 ) Wait --- harbour/ChangeLog | 10 ++++++++++ harbour/src/rtl/teditor.prg | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 6550d39a2b..c8bea8ab70 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,16 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-03-21 20:30 UTC+0100 Xavi (jarabal/at/gmail.com) + * harbour/src/rtl/teditor.prg + ! Fixing MemoEdit parameter calculation: nTextBuffRow, nWindowColumn. + + Procedure Main() + Cls + // Put 5 in the 5 position and next BS to change. + ? MemoEdit( "123",,, MaxRow(), MaxCol(),,,,,, 5 ) + Wait + 2010-03-21 20:00 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/src/macro/macro.y + added support for diff --git a/harbour/src/rtl/teditor.prg b/harbour/src/rtl/teditor.prg index 9b29a52bd7..bdc420b6c0 100644 --- a/harbour/src/rtl/teditor.prg +++ b/harbour/src/rtl/teditor.prg @@ -1019,10 +1019,10 @@ METHOD New( cString, nTop, nLeft, nBottom, nRight, lEditMode, nLineLength, nTabS nWndCol := Max( 0, nWndCol ) ::nFirstRow := Max( 1, nTextRow - nWndRow ) - ::nFirstCol := Max( 1, nTextCol - nWndCol ) + ::nFirstCol := Max( 1, nTextCol - nWndCol + 1 ) ::nRow := Max( 1, Min( nTextRow, ::naTextLen ) ) - ::nCol := Max( 1, Min( Len( ::aText[ ::nRow ]:cText ), nTextCol + 1 ) ) + ::nCol := Max( 1, nTextCol + 1 ) // extra sanitization over max bounds IF ::nFirstRow > ::naTextLen