From cb41bdea0d3b3119dadc161ef81b9502119db61c Mon Sep 17 00:00:00 2001 From: mattias Date: Mon, 14 Jul 2008 07:27:58 +0000 Subject: [PATCH] from Martin Friebe: - inserting a line, would not correctly re-paint the other lines, if a folded block was in the visible window, above the newly inserted line - using ctr-cursur-up to scroll, would make the cursor jump away from the lower end of the window, if a folded block existed - bracket search did not use ScreenRowToRow for "VisibleOnly" (which appears un-used, so this part of the bug is currently not triggered) git-svn-id: trunk@15776 - --- components/synedit/synedit.pp | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/components/synedit/synedit.pp b/components/synedit/synedit.pp index 2c99effb3c..fc246906ef 100644 --- a/components/synedit/synedit.pp +++ b/components/synedit/synedit.pp @@ -6285,8 +6285,8 @@ begin if (Lines.Count > 1) then ScanFrom(0); end; - InvalidateLines(Index + 1, TopLine + LinesInWindow); - InvalidateGutterLines(Index + 1, TopLine + LinesInWindow); + InvalidateLines(Index + 1, {$IFDEF SYN_LAZARUS}ScreenRowToRow(LinesInWindow+1){$ELSE}TopLine + LinesInWindow{$ENDIF}); + InvalidateGutterLines(Index + 1, {$IFDEF SYN_LAZARUS}ScreenRowToRow(LinesInWindow+1){$ELSE}TopLine + LinesInWindow{$ENDIF}); end; procedure TCustomSynEdit.ListPutted(Index: Integer); @@ -8593,8 +8593,8 @@ begin ecScrollUp: begin TopLine := TopLine - 1; - if CaretY > TopLine + LinesInWindow - 1 then - CaretY := TopLine + LinesInWindow - 1; + if CaretY > {$IFDEF SYN_LAZARUS}ScreenRowToRow(LinesInWindow-1){$ELSE}TopLine + LinesInWindow - 1{$ENDIF} then + CaretY := {$IFDEF SYN_LAZARUS}ScreenRowToRow(LinesInWindow-1){$ELSE}TopLine + LinesInWindow - 1{$ENDIF}; Update; end; ecScrollDown: @@ -10456,8 +10456,10 @@ procedure TCustomSynEdit.InvalidateLine(Line: integer); var rcInval: TRect; begin - if Visible and (Line >= TopLine) and (Line <= TopLine + LinesInWindow) and - (Line <= Lines.Count) and HandleAllocated + if Visible and (Line >= TopLine) and + (Line <= {$IFDEF SYN_LAZARUS}ScreenRowToRow(LinesInWindow){$ELSE} + TopLine + LinesInWindow{$ENDIF}) + and (Line <= Lines.Count) and HandleAllocated then begin {$IFDEF SYN_LAZARUS} fMarkupHighAll.InvalidateLines(Line, Line); @@ -10640,7 +10642,8 @@ var // get previous line if possible if PosY = 1 then break; Dec(PosY); - if OnlyVisible and ((PosY=TopLine+LinesInWindow)) + if OnlyVisible and ((PosY= {$IFDEF SYN_LAZARUS}ScreenRowToRow(LinesInWindow){$ELSE}TopLine+LinesInWindow{$ENDIF})) then break; Line := Lines[PosY - 1]; @@ -10667,7 +10670,8 @@ var // get next line if possible if PosY = Lines.Count then break; Inc(PosY); - if OnlyVisible and ((PosY=TopLine+LinesInWindow)) + if OnlyVisible and ((PosY < TopLine) + or (PosY >= {$IFDEF SYN_LAZARUS}ScreenRowToRow(LinesInWindow){$ELSE}TopLine+LinesInWindow{$ENDIF})) then break; Line := Lines[PosY - 1]; @@ -10703,7 +10707,8 @@ begin PosX := LogicalStart.X; PosY := LogicalStart.Y; if (PosY<1) or (PosY>Lines.Count) then exit; - if OnlyVisible and ((PosY=TopLine+LinesInWindow)) then + if OnlyVisible and ((PosY= {$IFDEF SYN_LAZARUS}ScreenRowToRow(LinesInWindow){$ELSE}TopLine+LinesInWindow{$ENDIF})) then exit; Line := LineText;