mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-05-14 08:02:43 +02:00
SynEdit: Fix markup over multiply tokens
git-svn-id: trunk@27830 -
This commit is contained in:
parent
1c4a0cc726
commit
b3b03bfaea
@ -3676,7 +3676,7 @@ var
|
||||
|
||||
// Calculate Markup
|
||||
fMarkupManager.MergeMarkupAttributeAtRowCol(FFoldedLinesView.TextIndex[CurLine]+1,
|
||||
PhysicalStartPos, FPaintLineColor2);
|
||||
PhysicalStartPos, PhysicalEndPos, FPaintLineColor2);
|
||||
|
||||
// Deal with equal colors
|
||||
if (FPaintLineColor2.Background = FPaintLineColor2.Foreground) then begin // or if diff(gb,fg) < x
|
||||
|
@ -150,7 +150,7 @@ type
|
||||
Procedure EndMarkup; override;
|
||||
Function GetMarkupAttributeAtRowCol(const aRow, aCol : Integer) : TSynSelectedColor; override;
|
||||
Function GetNextMarkupColAfterRowCol(const aRow, aCol : Integer) : Integer; override;
|
||||
Procedure MergeMarkupAttributeAtRowCol(const aRow, aCol : Integer; AMarkup: TSynSelectedColor);
|
||||
Procedure MergeMarkupAttributeAtRowCol(const aRow, aCol, AEndCol : Integer; AMarkup: TSynSelectedColor);
|
||||
|
||||
// Notifications about Changes to the text
|
||||
Procedure TextChanged(aFirstCodeLine, aLastCodeLine: Integer); override;
|
||||
@ -479,19 +479,17 @@ begin
|
||||
TSynEditMarkup(fMarkUpList[i]).PrepareMarkupForRow(aRow);
|
||||
end;
|
||||
|
||||
procedure TSynEditMarkupManager.MergeMarkupAttributeAtRowCol(const aRow, aCol: Integer;
|
||||
AMarkup: TSynSelectedColor);
|
||||
procedure TSynEditMarkupManager.MergeMarkupAttributeAtRowCol
|
||||
(const aRow, aCol, AEndCol: Integer; AMarkup: TSynSelectedColor);
|
||||
var
|
||||
i, EndCol : integer;
|
||||
c : TSynSelectedColor;
|
||||
begin
|
||||
EndCol := GetNextMarkupColAfterRowCol(aRow, aCol) - 1;
|
||||
|
||||
for i := 0 to fMarkUpList.Count-1 do begin
|
||||
if not TSynEditMarkup(fMarkUpList[i]).Enabled then continue;
|
||||
c := TSynEditMarkup(fMarkUpList[i]).GetMarkupAttributeAtRowCol(aRow, aCol);
|
||||
if assigned(c) then begin
|
||||
AMarkup.Merge(c, aCol, EndCol);
|
||||
AMarkup.Merge(c, aCol, AEndCol);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
@ -500,7 +498,7 @@ function TSynEditMarkupManager.GetMarkupAttributeAtRowCol(const aRow, aCol : Int
|
||||
begin
|
||||
Result := MarkupInfo;
|
||||
Result.Clear;
|
||||
MergeMarkupAttributeAtRowCol(aRow, aCol, Result);
|
||||
MergeMarkupAttributeAtRowCol(aRow, aCol, GetNextMarkupColAfterRowCol(aRow, aCol) - 1, Result);
|
||||
end;
|
||||
|
||||
function TSynEditMarkupManager.GetNextMarkupColAfterRowCol(const aRow, aCol : Integer) : Integer;
|
||||
|
Loading…
Reference in New Issue
Block a user