diff --git a/components/synedit/synguttermarks.pp b/components/synedit/synguttermarks.pp index 062bfcf43a..eb1e36a17b 100644 --- a/components/synedit/synguttermarks.pp +++ b/components/synedit/synguttermarks.pp @@ -155,9 +155,6 @@ var iRange: TLineRange; begin Result := False; - aFirstCustomColumnIdx := 0; - if FBookMarkOpt.DrawBookmarksFirst then - aFirstCustomColumnIdx := 1; aScreenLine := aScreenLine + ToIdx(GutterArea.TextArea.TopLine); j := ViewedTextBuffer.DisplayView.ViewToTextIndexEx(aScreenLine, iRange); if aScreenLine <> iRange.Top then @@ -173,6 +170,10 @@ begin else MLine.Sort(smsoBookMarkLast, smsoPriority); + aFirstCustomColumnIdx := 0; + if (FBookMarkOpt.DrawBookmarksFirst) and (MLine.Count < ColumnCount) then + aFirstCustomColumnIdx := 1; + LineHeight := SynEdit.LineHeight; //Gutter.Paint always supplies AClip.Left = GutterPart.Left lm := LeftMarginAtCurrentPPI; @@ -190,7 +191,7 @@ begin continue; if (MLine[j].IsBookmark <> LastMarkIsBookmark) and - (j = 0) and (FColumnCount > 1) + (j = 0) and (aFirstCustomColumnIdx >= 1) then begin // leave one column empty MarkRect.Left := MarkRect.Right;