From 4ab40af3a989353ae5b2a4d11449304408bcc905 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 8 Jun 2017 09:53:23 +0100 Subject: [PATCH] Disable idle timers on all transient contexts --- src/input_handler.cc | 16 ++++++++-------- 1 file 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()}, - 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());