From fd1d22521fee90cfdd395b8c157d510165d1f63e Mon Sep 17 00:00:00 2001 From: Martin Date: Sun, 22 Jun 2025 13:39:14 +0200 Subject: [PATCH] IDE: Special line highlight, if colors for a "special reason" (E.g. breakpoint) are not enabled, then continue search for other special reasons. (Or keep "current line" colors visible). Issue #41691 --- ide/sourceeditor.pp | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/ide/sourceeditor.pp b/ide/sourceeditor.pp index b4694387eb..cc785fa14c 100644 --- a/ide/sourceeditor.pp +++ b/ide/sourceeditor.pp @@ -5050,32 +5050,30 @@ begin aha := ahaNone; Special := False; - if ErrorLine = Line - then begin - aha := ahaErrorLine - end - else begin + if ErrorLine = Line then begin + EditorOpts.SetMarkupColor(TCustomSynEdit(Sender).Highlighter, ahaErrorLine, Markup); + Special := Markup.IsEnabled; + end; + + if not Special then begin SourceEditorMarks.GetMarksForLine(Self, Line, CurMarks, CurMarkCount); - if CurMarkCount > 0 then - begin - for i := 0 to CurMarkCount - 1 do - begin + if CurMarkCount > 0 then begin + for i := 0 to CurMarkCount - 1 do begin if not CurMarks[i].Visible then Continue; // check highlight attribute aha := CurMarks[i].LineColorAttrib; - if aha <> ahaNone then Break; + if aha = ahaNone then + Continue; + EditorOpts.SetMarkupColor(TCustomSynEdit(Sender).Highlighter, aha, Markup); + Special := Markup.IsEnabled; + if Special then + break; end; // clean up FreeMem(CurMarks); end; end; - - if aha <> ahaNone - then begin - Special := True; - EditorOpts.SetMarkupColor(TCustomSynEdit(Sender).Highlighter, aha, Markup); - end; end; procedure TSourceEditor.UpdateDefaultDefaultSyntaxHighlighterId(AForce: boolean);