SynEdit: remove circular dependency between SynEdit and SynEditMarkupHighAll

git-svn-id: trunk@64483 -
This commit is contained in:
ondrej 2021-02-05 13:26:18 +00:00
parent 608ef7b4c6
commit 454ff7cfe4
3 changed files with 10 additions and 10 deletions

View File

@ -986,7 +986,7 @@ type
out Attri: TSynHighlighterAttributes): boolean; //L505
procedure CaretAtIdentOrString(XY: TPoint; out AtIdent, NearString: Boolean);
procedure GetWordBoundsAtRowCol(const XY: TPoint; out StartX, EndX: integer); override;
function GetWordAtRowCol(XY: TPoint): string;
function GetWordAtRowCol(XY: TPoint): string; override;
function NextTokenPos: TPoint; virtual; deprecated; // use next word pos instead
function NextWordPos: TPoint; virtual;
function PrevWordPos: TPoint; virtual;

View File

@ -440,7 +440,6 @@ type
end;
implementation
uses SynEdit;
const
SEARCH_START_OFFS = 100; // Search n lises before/after visible area. (Before applies only, if no exact offset can not be calculated from searchtext)
@ -2726,27 +2725,27 @@ begin
exit('');
if FToggledWord <> '' then
exit(FToggledWord);
If TCustomSynEdit(SynEdit).SelAvail then begin
LowBnd := TCustomSynEdit(SynEdit).BlockBegin;
UpBnd := TCustomSynEdit(SynEdit).BlockEnd;
If SynEdit.SelAvail then begin
LowBnd := SynEdit.BlockBegin;
UpBnd := SynEdit.BlockEnd;
i := UpBnd.y - LowBnd.y + 1;
if (i > LowBnd.y) and (i > Lines.Count - UpBnd.y) then
exit('');
if FTrim then
Result := TrimS(TCustomSynEdit(SynEdit).SelText)
Result := TrimS(SynEdit.SelText)
else
Result := TCustomSynEdit(SynEdit).SelText;
Result := SynEdit.SelText;
if TrimS(Result) = '' then Result := '';
FLowBound := LowBnd;
FUpBound := UpBnd;
end else begin
Result := TCustomSynEdit(SynEdit).GetWordAtRowCol(Caret.LineBytePos);
Result := SynEdit.GetWordAtRowCol(Caret.LineBytePos);
if FIgnoreKeywords and assigned(FHighlighter)
and FHighlighter.IsKeyword(Result) then
Result := '';
FLowBound.Y := Caret.LinePos;
FUpBound.Y := Caret.LinePos;
TCustomSynEdit(SynEdit).GetWordBoundsAtRowCol(Caret.LineBytePos, FLowBound.X, FUpBound.X);
SynEdit.GetWordBoundsAtRowCol(Caret.LineBytePos, FLowBound.X, FUpBound.X);
end;
end;
@ -2762,7 +2761,7 @@ function TSynEditMarkupHighlightAllCaret.GetCurrentOption: TSynSearchOptions;
begin
if FToggledWord <> '' then
exit(FToggledOption);
If TCustomSynEdit(SynEdit).SelAvail or not(FFullWord) then
If SynEdit.SelAvail or not(FFullWord) then
Result := []
else
if (FFullWordMaxLen >0) and (UTF8Length(GetCurrentText) > FFullWordMaxLen) then

View File

@ -217,6 +217,7 @@ type
function TextXYToScreenXY(APhysTextXY: TPhysPoint): TPhysPoint; virtual; abstract;
procedure GetWordBoundsAtRowCol(const XY: TPoint; out StartX, EndX: integer); virtual; abstract;
function GetWordAtRowCol(XY: TPoint): string; virtual; abstract;
// Cursor
procedure UpdateCursorOverride; virtual; abstract;