diff options
| author | Maxime Coste <mawww@kakoune.org> | 2018-03-27 07:40:44 +1100 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2018-03-27 07:40:44 +1100 |
| commit | 0a833371ab7af35c5e574431056e86fe71526d50 (patch) | |
| tree | 48db6f1447e73c44c442e9edaf1048fddb3069f4 /src/input_handler.cc | |
| parent | 3d3a37a80cec3be1b38c8176fab0425279c19303 (diff) | |
Prompt: Do not call callback in on_enabled
Schedule it for later, when we get "idle". It currently can lead to
crashed because after the callback, the current mode might be different,
leading to a crash when doing the ModeChange hook call.
Diffstat (limited to 'src/input_handler.cc')
| -rw-r--r-- | src/input_handler.cc | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/input_handler.cc b/src/input_handler.cc index 20228dd1..8592e94d 100644 --- a/src/input_handler.cc +++ b/src/input_handler.cc @@ -968,8 +968,7 @@ private: void on_enabled() override { display(); - m_line_changed = false; - m_callback(m_line_editor.line(), PromptEvent::Change, context()); + m_line_changed = true; if (not (context().flags() & Context::Flags::Transient)) m_idle_timer.set_next_date(Clock::now() + get_idle_timeout(context())); |
