From b3b03bfaeac7478e7bef4825bb2e6dd54fd99cfd Mon Sep 17 00:00:00 2001 From: martin Date: Sun, 24 Oct 2010 16:12:15 +0000 Subject: [PATCH] SynEdit: Fix markup over multiply tokens git-svn-id: trunk@27830 - --- components/synedit/synedit.pp | 2 +- components/synedit/syneditmarkup.pp | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/components/synedit/synedit.pp b/components/synedit/synedit.pp index 28ad11fc3b..7d24fa8d4f 100644 --- a/components/synedit/synedit.pp +++ b/components/synedit/synedit.pp @@ -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 diff --git a/components/synedit/syneditmarkup.pp b/components/synedit/syneditmarkup.pp index 20bcc94566..a47296b4f9 100644 --- a/components/synedit/syneditmarkup.pp +++ b/components/synedit/syneditmarkup.pp @@ -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;