diff options
| author | Maxime Coste <mawww@kakoune.org> | 2017-06-08 09:53:23 +0100 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2017-06-08 09:53:23 +0100 |
| commit | 4ab40af3a989353ae5b2a4d11449304408bcc905 (patch) | |
| tree | 8363a453238604d3cea1bdb32596d67a46d54fb6 /src/input_handler.cc | |
| parent | 609b0bbbac7e8aaf4e5317032c6dd2cc53b22813 (diff) | |
Disable idle timers on all transient contexts
Diffstat (limited to 'src/input_handler.cc')
| -rw-r--r-- | src/input_handler.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/input_handler.cc b/src/input_handler.cc index 4f977876..5d88a4f5 100644 --- a/src/input_handler.cc +++ b/src/input_handler.cc @@ -160,16 +160,16 @@ public: : InputMode(input_handler), m_idle_timer{TimePoint::max(), context().flags() & Context::Flags::Transient ? - Timer::Callback() : Timer::Callback([this](Timer& timer) { + Timer::Callback{} : [this](Timer&) { context().hooks().run_hook("NormalIdle", "", context()); - })}, + }}, m_fs_check_timer{TimePoint::max(), context().flags() & Context::Flags::Transient ? - Timer::Callback() : Timer::Callback([this](Timer& timer) { + Timer::Callback{} : Timer::Callback{[this](Timer& timer) { if (context().has_client()) context().client().check_if_buffer_needs_reloading(); timer.set_next_date(Clock::now() + get_fs_check_timeout(context())); - })}, + }}}, m_single_command(single_command) {} @@ -694,8 +694,8 @@ public: : InputMode(input_handler), m_prompt(prompt.str()), m_prompt_face(face), m_flags(flags), m_completer(std::move(completer)), m_callback(std::move(callback)), m_autoshowcompl{context().options()["autoshowcompl"].get<bool>()}, - m_idle_timer{TimePoint::max(), - [this](Timer& timer) { + m_idle_timer{TimePoint::max(), context().flags() & Context::Flags::Transient ? + Timer::Callback{} : [this](Timer&) { if (m_autoshowcompl and m_refresh_completion_pending) refresh_completions(CompletionFlags::Fast); if (m_line_changed) @@ -1037,8 +1037,8 @@ public: m_edition(context()), m_completer(context()), m_autoshowcompl(true), - m_idle_timer{TimePoint::max(), - [this](Timer& timer) { + m_idle_timer{TimePoint::max(), context().flags() & Context::Flags::Transient ? + Timer::Callback{} : [this](Timer&) { if (m_autoshowcompl) m_completer.update(); context().hooks().run_hook("InsertIdle", "", context()); |
