diff --git a/src/lay/lay/layMacroEditorPage.cc b/src/lay/lay/layMacroEditorPage.cc index 30249ac0b..319bf7fbc 100644 --- a/src/lay/lay/layMacroEditorPage.cc +++ b/src/lay/lay/layMacroEditorPage.cc @@ -548,7 +548,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); @@ -662,6 +664,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);