SynEdit: remove circular dependency between SynEdit and SynGutterChanges

git-svn-id: trunk@64486 -
This commit is contained in:
ondrej 2021-02-05 13:32:42 +00:00
parent 2c18181316
commit e966434b1a
4 changed files with 9 additions and 9 deletions

View File

@ -264,8 +264,6 @@ type
TCustomSynEdit = class; TCustomSynEdit = class;
TSynLineState = (slsNone, slsSaved, slsUnsaved);
{ TLazSynEditPlugin } { TLazSynEditPlugin }
@ -947,7 +945,7 @@ type
); );
function GetLineState(ALine: Integer): TSynLineState; function GetLineState(ALine: Integer): TSynLineState; override;
procedure MarkTextAsSaved; procedure MarkTextAsSaved;
// BoorMark // BoorMark

View File

@ -291,6 +291,9 @@ type
procedure InvalidateLine(Line: integer); virtual; abstract; procedure InvalidateLine(Line: integer); virtual; abstract;
procedure InvalidateGutterLines(FirstLine, LastLine: integer); virtual; abstract; // Currently invalidates full line => that may change procedure InvalidateGutterLines(FirstLine, LastLine: integer); virtual; abstract; // Currently invalidates full line => that may change
procedure InvalidateLines(FirstLine, LastLine: integer); virtual; abstract; procedure InvalidateLines(FirstLine, LastLine: integer); virtual; abstract;
// text / lines
function GetLineState(ALine: Integer): TSynLineState; virtual; abstract;
public public
// Byte to Char // Byte to Char
function LogicalToPhysicalPos(const p: TPoint): TPoint; virtual; abstract; function LogicalToPhysicalPos(const p: TPoint): TPoint; virtual; abstract;

View File

@ -67,6 +67,7 @@ type
X, Y, Offs: Integer; X, Y, Offs: Integer;
end; end;
TSynLineState = (slsNone, slsSaved, slsUnsaved);
TSynCoordinateMappingFlag = ( TSynCoordinateMappingFlag = (
scmLimitToLines, scmLimitToLines,

View File

@ -6,7 +6,7 @@ interface
uses uses
Classes, FPCanvas, Graphics, LCLType, LCLIntf, SynGutterBase, Classes, FPCanvas, Graphics, LCLType, LCLIntf, SynGutterBase,
SynEditMiscProcs, LazSynEditText; SynEditMiscProcs, LazSynEditText, SynEditTypes;
type type
{ TSynGutterChanges } { TSynGutterChanges }
@ -29,8 +29,6 @@ type
end; end;
implementation implementation
uses
SynEdit;
{ TSynGutterChanges } { TSynGutterChanges }
@ -82,8 +80,8 @@ var
begin begin
if not Visible then exit; if not Visible then exit;
LineHeight := TCustomSynEdit(SynEdit).LineHeight; LineHeight := SynEdit.LineHeight;
c := TCustomSynEdit(SynEdit).Lines.Count; c := SynEdit.Lines.Count;
t := ToIdx(GutterArea.TextArea.TopLine); t := ToIdx(GutterArea.TextArea.TopLine);
if MarkupInfo.Background <> clNone then if MarkupInfo.Background <> clNone then
@ -108,7 +106,7 @@ begin
rcLine.Top := rcLine.Bottom; rcLine.Top := rcLine.Bottom;
Inc(rcLine.Bottom, LineHeight); Inc(rcLine.Bottom, LineHeight);
case TCustomSynEdit(SynEdit).GetLineState(iLine) of case SynEdit.GetLineState(iLine) of
slsNone: ; slsNone: ;
slsSaved: slsSaved:
begin begin