From dae0a9abe64817125da07d56641c0bf874431fe1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Mon, 22 Aug 2022 14:29:35 +0200 Subject: [PATCH] Text & code editor: Call the TextEditor.Reset() method when loading the contents, not to raise the Change event. [DEVELOPMENT ENVIRONMENT] * BUG: Text & code editor: Call the TextEditor.Reset() method when loading the contents, not to raise the Change event. --- app/src/gambas3/.src/Editor/Code/FEditor.class | 9 ++------- app/src/gambas3/.src/Editor/Code/FTextEditor.class | 2 ++ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/app/src/gambas3/.src/Editor/Code/FEditor.class b/app/src/gambas3/.src/Editor/Code/FEditor.class index 5fd15b02b..1a4290f5a 100644 --- a/app/src/gambas3/.src/Editor/Code/FEditor.class +++ b/app/src/gambas3/.src/Editor/Code/FEditor.class @@ -41,7 +41,6 @@ Static Private $sName As String Private $hEditor As TextEditor Private $bModify As Boolean -Private $bIgnoreNextChange As Boolean Private $bToolbar As Boolean Private $iLastLine As Integer @@ -374,10 +373,6 @@ End Public Sub Editors_Change() - If $bIgnoreNextChange Then - $bIgnoreNextChange = False - Return - Endif Modify End @@ -2274,8 +2269,6 @@ End Public Sub Reload() - $bIgnoreNextChange = True - edtEditor.Load(Path, True) $hBookmark.Load() Breakpoints.Load(Me) @@ -2287,6 +2280,8 @@ Public Sub Reload() SetReadOnly UpdateDiffAction + + $hEditor.Reset End diff --git a/app/src/gambas3/.src/Editor/Code/FTextEditor.class b/app/src/gambas3/.src/Editor/Code/FTextEditor.class index da40e8a02..87c59a510 100644 --- a/app/src/gambas3/.src/Editor/Code/FTextEditor.class +++ b/app/src/gambas3/.src/Editor/Code/FTextEditor.class @@ -731,6 +731,8 @@ Public Sub Reload() If Settings["/FormatCode/FormatOnLoad"] Then MPrettyCode.Run(Me) UpdateDiffAction + + $hEditor.Reset End