Skip to content

Commit 4ab3d95

Browse files
Merge pull request #2324 from KLayout/bugfix/issue-2301
Hopefully fixing issue #2320
2 parents 8e64d1e + 97aa28d commit 4ab3d95

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

src/lay/lay/layMacroEditorPage.cc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,9 @@ void MacroEditorSidePanel::paintEvent (QPaintEvent *)
548548
// MacroEditorPage implementation
549549

550550
MacroEditorPage::MacroEditorPage (QWidget * /*parent*/, MacroEditorHighlighters *highlighters)
551-
: 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)
551+
: mp_macro (0), mp_highlighters (highlighters), mp_highlighter (0),
552+
m_error_line (-1), m_ntab (8), m_nindent (2), m_ignore_cursor_changed_event (false),
553+
dm_run_mode_changed (this, &MacroEditorPage::do_run_mode_changed)
552554
{
553555
mp_layout = new QVBoxLayout (this);
554556
mp_layout->setContentsMargins (0, 0, 0, 0);
@@ -662,6 +664,11 @@ void MacroEditorPage::current_line_changed ()
662664
}
663665

664666
void MacroEditorPage::run_mode_changed ()
667+
{
668+
dm_run_mode_changed ();
669+
}
670+
671+
void MacroEditorPage::do_run_mode_changed ()
665672
{
666673
// this prevents recursion when the following lines trigger anything that routes through the interpreter
667674
bool bl = mp_exec_model->blockSignals (true);

src/lay/lay/layMacroEditorPage.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "lymMacro.h"
2929
#include "layGenericSyntaxHighlighter.h"
3030
#include "tlVariant.h"
31+
#include "tlDeferredExecution.h"
3132

3233
#include <QDialog>
3334
#include <QPixmap>
@@ -417,12 +418,14 @@ protected slots:
417418
QListWidget *mp_completer_list;
418419
std::list<MacroEditorNotification> m_notifications;
419420
std::map<const MacroEditorNotification *, QWidget *, CompareNotificationPointers> m_notification_widgets;
421+
tl::DeferredMethod<lay::MacroEditorPage> dm_run_mode_changed;
420422

421423
void update_extra_selections ();
422424
bool return_pressed ();
423425
bool backspace_pressed ();
424426
bool back_tab_key_pressed ();
425427
bool tab_key_pressed ();
428+
void do_run_mode_changed ();
426429
void fill_completer_list ();
427430
void complete ();
428431
QTextCursor get_completer_cursor (int &pos0, int &pos);

0 commit comments

Comments
 (0)