synedit: fixed updating gutter when codefolding ranges changed

git-svn-id: trunk@10412 -
This commit is contained in:
mattias 2007-01-10 11:17:02 +00:00
parent e8fa91fe05
commit 40a2432420
2 changed files with 15 additions and 7 deletions

View File

@ -2042,7 +2042,9 @@ begin
if Visible and HandleAllocated then if Visible and HandleAllocated then
if (FirstLine = -1) and (LastLine = -1) then begin if (FirstLine = -1) and (LastLine = -1) then begin
rcInval := ClientRect; rcInval := ClientRect;
{$IFNDEF SYN_LAZARUS}
rcInval.Left := fGutterWidth; rcInval.Left := fGutterWidth;
{$ENDIF}
if sfLinesChanging in fStateFlags then if sfLinesChanging in fStateFlags then
UnionRect(fInvalidateRect, fInvalidateRect, rcInval) UnionRect(fInvalidateRect, fInvalidateRect, rcInval)
else else
@ -2060,12 +2062,14 @@ begin
); );
{ any line visible? } { any line visible? }
if (LastLine >= FirstLine) then begin if (LastLine >= FirstLine) then begin
rcInval := Rect(fGutterWidth, {$IFDEF SYN_LAZARUS}
fTextHeight * {$IFDEF SYN_LAZARUS}RowToScreenRow(FirstLine) rcInval := Rect(0,fTextHeight * RowToScreenRow(FirstLine),
{$ELSE}(FirstLine - TopLine){$ENDIF}, ClientWidth-ScrollBarWidth,
ClientWidth{$IFDEF SYN_LAZARUS}-ScrollBarWidth{$ENDIF}, fTextHeight * (RowToScreenRow(LastLine)+1));
fTextHeight * {$IFDEF SYN_LAZARUS}(RowToScreenRow(LastLine)+1) {$ELSE}
{$ELSE}(LastLine - TopLine + 1){$ENDIF}); rcInval := Rect(fGutterWidth,fTextHeight * (FirstLine - TopLine),
ClientWidth, fTextHeight * (LastLine - TopLine + 1));
{$ENDIF}
if sfLinesChanging in fStateFlags then if sfLinesChanging in fStateFlags then
UnionRect(fInvalidateRect, fInvalidateRect, rcInval) UnionRect(fInvalidateRect, fInvalidateRect, rcInval)
else else
@ -2393,7 +2397,7 @@ begin
and (Y >= 0) and (Y >= 0)
and (Y < ClientHeight{$IFDEF SYN_LAZARUS}-ScrollBarWidth{$ENDIF}) and (Y < ClientHeight{$IFDEF SYN_LAZARUS}-ScrollBarWidth{$ENDIF})
then begin then begin
if Cursor <> crHandPoint then if (Cursor <> crHandPoint) or (not (ssCtrl in Shift)) then
Cursor := crIBeam; Cursor := crIBeam;
end end
else else

View File

@ -698,6 +698,10 @@ begin
Result := tkKey; Result := tkKey;
fRange := rsAsm; fRange := rsAsm;
fAsmStart := True; 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 else Result := tkIdentifier;
end; end;