From a53acf81c7c9c2cf90ee7e878b05c8d521e82c88 Mon Sep 17 00:00:00 2001 From: gambas Date: Tue, 21 Apr 2020 07:32:52 +0200 Subject: [PATCH] TextEditor: Do not use Application.Busy in Load() and Save() methods and fix TextEditor[].Purge() method. [GB.FORM.EDITOR] * NEW: TextEditor: Do not use Application.Busy in Load() and Save() methods. * BUG: TextEditor: TextEditor[].Purge() works as expected now. --- comp/src/gb.form.editor/.src/TextEditor.class | 24 +++++++++---------- .../.src/_TextEditor_Line.class | 3 ++- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/comp/src/gb.form.editor/.src/TextEditor.class b/comp/src/gb.form.editor/.src/TextEditor.class index 517d8ba4c..763d95ff4 100644 --- a/comp/src/gb.form.editor/.src/TextEditor.class +++ b/comp/src/gb.form.editor/.src/TextEditor.class @@ -396,32 +396,32 @@ End Public Sub Load(Path As String, Optional AddNewLine As Boolean) - Inc Application.Busy + 'Inc Application.Busy Goto(0, 0) $hDoc.Load(Path, AddNewLine) Init If $bShowPreview Then $hTimerSideBarRefresh.Trigger - Dec Application.Busy + 'Dec Application.Busy -Catch - - Dec Application.Busy - Error.Propagate +' Catch +' +' Dec Application.Busy +' Error.Propagate End Public Sub Save(Path As String) - Inc Application.Busy + 'Inc Application.Busy $hDoc.HighlightFrom($Y) $hDoc.Save(Path) $hTimerChange = Null - Dec Application.Busy + 'Dec Application.Busy -Catch - - Dec Application.Busy - Error.Propagate +' Catch +' +' 'Dec Application.Busy +' Error.Propagate End diff --git a/comp/src/gb.form.editor/.src/_TextEditor_Line.class b/comp/src/gb.form.editor/.src/_TextEditor_Line.class index 74ca2f37c..5d6a51739 100644 --- a/comp/src/gb.form.editor/.src/_TextEditor_Line.class +++ b/comp/src/gb.form.editor/.src/_TextEditor_Line.class @@ -133,7 +133,8 @@ Public Sub Purge(Optional KeepComment As Boolean, KeepString As Boolean, Replace If iState = Highlight.Comment Or If iState = Highlight.Help Then bReplace = True Endif - Else If Not KeepString And If iState = Highlight.String Then + Endif + If Not KeepString And If iState = Highlight.String Then bReplace = True Endif If bReplace Then