From e947c20ce03ea0bd0f1c7b247804732b33776a4c Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 7 Jun 2017 20:19:34 +0100 Subject: [PATCH] Do not disable incsearch option in context wrap It will only trigger on idle, which should not happen during non- interactive contexts. --- src/commands.cc | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/src/commands.cc b/src/commands.cc index 9ba39591..9983c0ec 100644 --- a/src/commands.cc +++ b/src/commands.cc @@ -1495,20 +1495,6 @@ const ParameterDesc context_wrap_params = { ParameterDesc::Flags::SwitchesOnlyAtStart, 1 }; -template -struct DisableOption { - DisableOption(Context& context, const char* name) - : m_option(context.options()[name]), - m_prev_value(m_option.get()) - { m_option.set(T{}, false); } - - ~DisableOption() { m_option.set(m_prev_value, false); } - -private: - Option& m_option; - T m_prev_value; -}; - class RegisterRestorer { public: @@ -1552,10 +1538,6 @@ void context_wrap(const ParametersParser& parser, Context& context, Func func) (int)(bool)parser.get_switch("try-client") > 1) throw runtime_error{"Only one of -buffer, -client or -try-client can be specified"}; - // Disable these options to avoid costly code paths (and potential screen - // redraws) That are useful only in interactive contexts. - DisableOption disable_incsearch(context, "incsearch"); - const bool no_hooks = parser.get_switch("no-hooks") or context.hooks_disabled(); const bool no_keymaps = not parser.get_switch("with-maps");