From 97aa28d01b7f976c5ed60cc8f2ca854171c60036 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Thu, 9 Apr 2026 22:25:16 +0200 Subject: [PATCH] Hopefully fixing issue #2320 --- src/lay/lay/layMacroEditorPage.cc | 9 ++++++++- src/lay/lay/layMacroEditorPage.h | 3 +++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/lay/lay/layMacroEditorPage.cc b/src/lay/lay/layMacroEditorPage.cc index 98d65f5e0..e0d00e5db 100644 --- a/src/lay/lay/layMacroEditorPage.cc +++ b/src/lay/lay/layMacroEditorPage.cc @@ -544,7 +544,9 @@ void MacroEditorSidePanel::paintEvent (QPaintEvent *) // MacroEditorPage implementation MacroEditorPage::MacroEditorPage (QWidget * /*parent*/, MacroEditorHighlighters *highlighters) - : mp_macro (0), mp_highlighters (highlighters), mp_highlighter (0), m_error_line (-1), m_ntab (8), m_nindent (2), m_ignore_cursor_changed_event (false) + : mp_macro (0), mp_highlighters (highlighters), mp_highlighter (0), + m_error_line (-1), m_ntab (8), m_nindent (2), m_ignore_cursor_changed_event (false), + dm_run_mode_changed (this, &MacroEditorPage::do_run_mode_changed) { mp_layout = new QVBoxLayout (this); mp_layout->setContentsMargins (0, 0, 0, 0); @@ -658,6 +660,11 @@ void MacroEditorPage::current_line_changed () } void MacroEditorPage::run_mode_changed () +{ + dm_run_mode_changed (); +} + +void MacroEditorPage::do_run_mode_changed () { // this prevents recursion when the following lines trigger anything that routes through the interpreter bool bl = mp_exec_model->blockSignals (true); diff --git a/src/lay/lay/layMacroEditorPage.h b/src/lay/lay/layMacroEditorPage.h index d0984c736..925070ab8 100644 --- a/src/lay/lay/layMacroEditorPage.h +++ b/src/lay/lay/layMacroEditorPage.h @@ -28,6 +28,7 @@ #include "lymMacro.h" #include "layGenericSyntaxHighlighter.h" #include "tlVariant.h" +#include "tlDeferredExecution.h" #include #include @@ -417,12 +418,14 @@ private: QListWidget *mp_completer_list; std::list m_notifications; std::map m_notification_widgets; + tl::DeferredMethod dm_run_mode_changed; void update_extra_selections (); bool return_pressed (); bool backspace_pressed (); bool back_tab_key_pressed (); bool tab_key_pressed (); + void do_run_mode_changed (); void fill_completer_list (); void complete (); QTextCursor get_completer_cursor (int &pos0, int &pos);