From 40a2432420b19cc0edfb879f7f1c2cb58688bb83 Mon Sep 17 00:00:00 2001 From: mattias Date: Wed, 10 Jan 2007 11:17:02 +0000 Subject: [PATCH] synedit: fixed updating gutter when codefolding ranges changed git-svn-id: trunk@10412 - --- components/synedit/synedit.pp | 18 +++++++++++------- components/synedit/synhighlighterpas.pp | 4 ++++ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/components/synedit/synedit.pp b/components/synedit/synedit.pp index f6061679db..0ebea4d074 100644 --- a/components/synedit/synedit.pp +++ b/components/synedit/synedit.pp @@ -2042,7 +2042,9 @@ begin if Visible and HandleAllocated then if (FirstLine = -1) and (LastLine = -1) then begin rcInval := ClientRect; + {$IFNDEF SYN_LAZARUS} rcInval.Left := fGutterWidth; + {$ENDIF} if sfLinesChanging in fStateFlags then UnionRect(fInvalidateRect, fInvalidateRect, rcInval) else @@ -2060,12 +2062,14 @@ begin ); { any line visible? } if (LastLine >= FirstLine) then begin - rcInval := Rect(fGutterWidth, - fTextHeight * {$IFDEF SYN_LAZARUS}RowToScreenRow(FirstLine) - {$ELSE}(FirstLine - TopLine){$ENDIF}, - ClientWidth{$IFDEF SYN_LAZARUS}-ScrollBarWidth{$ENDIF}, - fTextHeight * {$IFDEF SYN_LAZARUS}(RowToScreenRow(LastLine)+1) - {$ELSE}(LastLine - TopLine + 1){$ENDIF}); + {$IFDEF SYN_LAZARUS} + rcInval := Rect(0,fTextHeight * RowToScreenRow(FirstLine), + ClientWidth-ScrollBarWidth, + fTextHeight * (RowToScreenRow(LastLine)+1)); + {$ELSE} + rcInval := Rect(fGutterWidth,fTextHeight * (FirstLine - TopLine), + ClientWidth, fTextHeight * (LastLine - TopLine + 1)); + {$ENDIF} if sfLinesChanging in fStateFlags then UnionRect(fInvalidateRect, fInvalidateRect, rcInval) else @@ -2393,7 +2397,7 @@ begin and (Y >= 0) and (Y < ClientHeight{$IFDEF SYN_LAZARUS}-ScrollBarWidth{$ENDIF}) then begin - if Cursor <> crHandPoint then + if (Cursor <> crHandPoint) or (not (ssCtrl in Shift)) then Cursor := crIBeam; end else diff --git a/components/synedit/synhighlighterpas.pp b/components/synedit/synhighlighterpas.pp index 4f9b021aeb..43db0d4022 100644 --- a/components/synedit/synhighlighterpas.pp +++ b/components/synedit/synhighlighterpas.pp @@ -698,6 +698,10 @@ begin Result := tkKey; fRange := rsAsm; fAsmStart := True; + {$IFDEF SYN_LAZARUS} + StartPascalCodeFoldBlock(cfbtBeginEnd); + //debugln('TSynPasSyn.Func37 BEGIN ',dbgs(ord(TopPascalCodeFoldBlockType)),' LineNumber=',dbgs(fLineNumber),' ',dbgs(MinimumCodeFoldBlockLevel),' ',dbgs(CurrentCodeFoldBlockLevel)); + {$ENDIF} end else Result := tkIdentifier; end;