SynEdit, debugln

git-svn-id: trunk@34931 -
This commit is contained in:
martin 2012-01-25 15:48:33 +00:00
parent 50a7259d40
commit 42b45fa381
3 changed files with 22 additions and 6 deletions

View File

@ -213,7 +213,7 @@ begin
- TextArea.TopLine + 2) * TextArea.LineHeight); - TextArea.TopLine + 2) * TextArea.LineHeight);
{$IFDEF VerboseSynEditInvalidate} {$IFDEF VerboseSynEditInvalidate}
DebugLn(['TCustomSynEdit.InvalidateGutterLines ',DbgSName(self), ' FirstLine=',FirstLine, ' LastLine=',LastLine, ' rect=',dbgs(rcInval)]); DebugLn(['TCustomSynEdit.InvalidateGutterLines ',DbgSName(self), ' FirstLine=',FirstTextLine, ' LastLine=',LastTextLine, ' rect=',dbgs(rcInval)]);
{$ENDIF} {$ENDIF}
if (rcInval.Top < rcInval.Bottom) and (rcInval.Left < rcInval.Right) then if (rcInval.Top < rcInval.Bottom) and (rcInval.Left < rcInval.Right) then
InvalidateRect(Handle, @rcInval, FALSE); InvalidateRect(Handle, @rcInval, FALSE);
@ -396,7 +396,7 @@ begin
- TopLine + 2) * LineHeight); - TopLine + 2) * LineHeight);
{$IFDEF VerboseSynEditInvalidate} {$IFDEF VerboseSynEditInvalidate}
DebugLn(['TCustomSynEdit.InvalidateGutterLines ',DbgSName(self), ' FirstLine=',FirstLine, ' LastLine=',LastLine, ' rect=',dbgs(rcInval)]); DebugLn(['TCustomSynEdit.InvalidateGutterLines ',DbgSName(self), ' FirstLine=',FirstTextLine, ' LastLine=',LastTextLine, ' rect=',dbgs(rcInval)]);
{$ENDIF} {$ENDIF}
if (rcInval.Top < rcInval.Bottom) and (rcInval.Left < rcInval.Right) then if (rcInval.Top < rcInval.Bottom) and (rcInval.Left < rcInval.Right) then
InvalidateRect(Handle, @rcInval, FALSE); InvalidateRect(Handle, @rcInval, FALSE);

View File

@ -47,6 +47,8 @@ unit SynEdit;
{$I synedit.inc} {$I synedit.inc}
{$DEFINE SYNSCROLLDEBUG}
{$IFDEF LCLGTK1} {$IFDEF LCLGTK1}
{$DEFINE EnableDoubleBuf} // gtk1 does not have double buffering {$DEFINE EnableDoubleBuf} // gtk1 does not have double buffering
{$ENDIF} {$ENDIF}
@ -2464,7 +2466,10 @@ var
TopFoldLine: LongInt; TopFoldLine: LongInt;
begin begin
if sfPainting in fStateFlags then exit; if sfPainting in fStateFlags then exit;
if Visible and HandleAllocated then if Visible and HandleAllocated then begin
{$IFDEF VerboseSynEditInvalidate}
DebugLnEnter(['TCustomSynEdit.InvalidateGutterLines ',DbgSName(self), ' FirstLine=',FirstLine, ' LastLine=',LastLine]);
{$ENDIF}
if (FirstLine = -1) and (LastLine = -1) then begin if (FirstLine = -1) and (LastLine = -1) then begin
FPaintArea.InvalidateGutterLines(-1, -1); FPaintArea.InvalidateGutterLines(-1, -1);
end else begin end else begin
@ -2477,6 +2482,10 @@ begin
FFoldedLinesView.TopLine := TopFoldLine; FFoldedLinesView.TopLine := TopFoldLine;
end; end;
{$IFDEF VerboseSynEditInvalidate}
DebugLnExit(['TCustomSynEdit.InvalidateGutterLines ',DbgSName(self)]);
{$ENDIF}
end;
end; end;
procedure TCustomSynEdit.InvalidateLines(FirstLine, LastLine: integer); procedure TCustomSynEdit.InvalidateLines(FirstLine, LastLine: integer);
@ -2484,7 +2493,10 @@ var
TopFoldLine: LongInt; TopFoldLine: LongInt;
begin begin
if sfPainting in fStateFlags then exit; if sfPainting in fStateFlags then exit;
if Visible and HandleAllocated then if Visible and HandleAllocated then begin
{$IFDEF VerboseSynEditInvalidate}
DebugLnEnter(['TCustomSynEdit.InvalidateTektLines ',DbgSName(self), ' FirstLine=',FirstLine, ' LastLine=',LastLine]);
{$ENDIF}
if (FirstLine = -1) and (LastLine = -1) then begin if (FirstLine = -1) and (LastLine = -1) then begin
FPaintArea.InvalidateTextLines(-1, -1); FPaintArea.InvalidateTextLines(-1, -1);
end else begin end else begin
@ -2497,6 +2509,10 @@ begin
FFoldedLinesView.TopLine := TopFoldLine; FFoldedLinesView.TopLine := TopFoldLine;
end; end;
{$IFDEF VerboseSynEditInvalidate}
DebugLnExit(['TCustomSynEdit.InvalidateTextLines ',DbgSName(self)]);
{$ENDIF}
end;
end; end;
procedure TCustomSynEdit.KeyDown(var Key: Word; Shift: TShiftState); procedure TCustomSynEdit.KeyDown(var Key: Word; Shift: TShiftState);

View File

@ -5,7 +5,7 @@ unit SynGutter;
interface interface
uses uses
SysUtils, Classes, Controls, Graphics, LCLType, LCLIntf, Menus, SysUtils, Classes, Controls, Graphics, LCLType, LCLIntf, LCLProc, Menus,
SynEditMarks, SynEditTypes, SynEditMiscClasses, SynEditMiscProcs, LazSynTextArea, SynEditMarks, SynEditTypes, SynEditMiscClasses, SynEditMiscProcs, LazSynTextArea,
SynTextDrawer, SynGutterBase, SynGutterLineNumber, SynGutterCodeFolding, SynTextDrawer, SynGutterBase, SynGutterLineNumber, SynGutterCodeFolding,
SynGutterMarks, SynGutterChanges, SynEditMouseCmds; SynGutterMarks, SynGutterChanges, SynEditMouseCmds;
@ -149,7 +149,7 @@ begin
- TextArea.TopLine + 2) * TextArea.LineHeight); - TextArea.TopLine + 2) * TextArea.LineHeight);
{$IFDEF VerboseSynEditInvalidate} {$IFDEF VerboseSynEditInvalidate}
DebugLn(['TCustomSynEdit.InvalidateGutterLines ',DbgSName(self), ' FirstLine=',FirstLine, ' LastLine=',LastLine, ' rect=',dbgs(rcInval)]); DebugLn(['TCustomSynEdit.InvalidateGutterLines ',DbgSName(self), ' FirstLine=',FirstTextLine, ' LastLine=',LastTextLine, ' rect=',dbgs(rcInval)]);
{$ENDIF} {$ENDIF}
if (rcInval.Top < rcInval.Bottom) and (rcInval.Left < rcInval.Right) then if (rcInval.Top < rcInval.Bottom) and (rcInval.Left < rcInval.Right) then
InvalidateRect(Handle, @rcInval, FALSE); InvalidateRect(Handle, @rcInval, FALSE);