From b4d24caa868cba99e62ff8d7d4f59e53f807d6ad Mon Sep 17 00:00:00 2001 From: Antonio Linares Date: Sat, 31 May 2003 19:04:28 +0000 Subject: [PATCH] several improvements for the debugger --- harbour/source/rtl/teditor.prg | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/harbour/source/rtl/teditor.prg b/harbour/source/rtl/teditor.prg index 8b8e6a2610..dc561b7056 100644 --- a/harbour/source/rtl/teditor.prg +++ b/harbour/source/rtl/teditor.prg @@ -462,12 +462,21 @@ METHOD GotoLine(nRow) CLASS HBEditor else // I need to move cursor if is past requested line number and if requested line is // inside first screen of text otherwise ::nFirstRow would be wrong - if nRow < ::nNumRows .AND. (::nTop + nRow) < ::Row() - ::SetPos(::nTop + nRow, ::Col()) + if ::nFirstRow > 1 + if nRow < ::nNumRows .AND. (::nTop + nRow) < ::Row() + ::SetPos(::nTop + nRow, ::Col()) + endif + else + if nRow <= ::nNumRows + ::SetPos(::nTop + nRow - 1, ::Col()) + endif endif ::nRow := nRow - ::nFirstRow := Max(1, nRow - (::Row() - ::nTop)) + + if ! ( ::nFirstRow == 1 .and. nRow <= ::nNumRows ) + ::nFirstRow := Max( 1, nRow - (::Row() - ::nTop)) + endif ::RefreshWindow() endif @@ -576,6 +585,7 @@ METHOD RefreshWindow() CLASS HBEditor LOCAL nOCol LOCAL nORow LOCAL nOCur + local cOldColor nOCol := ::Col() nORow := ::Row() @@ -587,7 +597,9 @@ METHOD RefreshWindow() CLASS HBEditor // Clear rest of editor window (needed when deleting lines of text) if ::naTextLen < ::nNumRows + cOldColor = SetColor( ::cColorSpec ) Scroll(::nTop + ::naTextLen, ::nLeft, ::nBottom, ::nRight) + SetColor( cOldColor ) endif SetCursor(nOCur)