From 084a2de23cc5e377413d8bc29b784961b570ff24 Mon Sep 17 00:00:00 2001 From: gambas Date: Mon, 1 Mar 2021 18:31:32 +0100 Subject: [PATCH] TextEditor: Checking the Limit property of a line now highlights until that line. [GB.FORM.EDITOR] * BUG: TextEditor: Checking the Limit property of a line now highlights until that line. --- comp/src/gb.form.editor/.src/CDocument.class | 6 +++++- comp/src/gb.form.editor/.src/TextEditor.class | 1 + comp/src/gb.form.editor/.src/_TextEditor_Line.class | 6 +++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/comp/src/gb.form.editor/.src/CDocument.class b/comp/src/gb.form.editor/.src/CDocument.class index 63c066305..346f79a1d 100644 --- a/comp/src/gb.form.editor/.src/CDocument.class +++ b/comp/src/gb.form.editor/.src/CDocument.class @@ -978,15 +978,19 @@ Public Sub HighlightUntil(Y As Integer) If $bHighlighting Then Return + Y = Min(Y, Lines.Max) + If $iNoHighlight Then $cHighlightLater[Y] = True Return Endif + If $iFirstInvalidHighlight > Y Then Return + If Not StartHighlight() Then Return iNextFirst = -1 - For L = $iFirstInvalidHighlight To Min(Y, Lines.Max) + For L = $iFirstInvalidHighlight To Y If L = $iDoNotHighlightLine And If Info(L).Modified Then If iNextFirst < 0 Then iNextFirst = L Continue diff --git a/comp/src/gb.form.editor/.src/TextEditor.class b/comp/src/gb.form.editor/.src/TextEditor.class index cf822f3f5..8acfd52bd 100644 --- a/comp/src/gb.form.editor/.src/TextEditor.class +++ b/comp/src/gb.form.editor/.src/TextEditor.class @@ -3606,6 +3606,7 @@ Public Sub FindNextLimit(Y As Integer) As Integer Do Inc Y If Y > $hDoc.Max Then Return -1 + $hDoc.HighlightUntil(Y) If $hDoc.Info(Y).Limit Then Return Y Loop diff --git a/comp/src/gb.form.editor/.src/_TextEditor_Line.class b/comp/src/gb.form.editor/.src/_TextEditor_Line.class index 41ea80510..7d0c19f63 100644 --- a/comp/src/gb.form.editor/.src/_TextEditor_Line.class +++ b/comp/src/gb.form.editor/.src/_TextEditor_Line.class @@ -70,7 +70,11 @@ End Private Function Limit_Read() As Boolean - Return GetDoc().Info(_Line).Limit + Dim hDoc As CDocument + + hDoc = GetDoc() + hDoc.HighlightUntil(_Line) + Return hDoc.Info(_Line).Limit End