From 689494fb2fe6bb368c1c11c400375503b5041c7a Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 20 Aug 2015 19:16:14 +0100 Subject: [PATCH] Fix reentrency in Normal::handle_key --- src/input_handler.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/input_handler.cc b/src/input_handler.cc index 4b4bd300..8ef17af9 100644 --- a/src/input_handler.cc +++ b/src/input_handler.cc @@ -244,9 +244,13 @@ public: if (context().options()["autoinfo"].get() >= 2 and context().has_ui()) context().ui().info_show(key_to_str(key), it->docstring, CharCoord{}, get_face("Information"), InfoStyle::Prompt); - it->func(context(), m_params); + + // reset m_params now to be reentrant + NormalParams params = m_params; + m_params = { 0, 0 }; + + it->func(context(), params); } - m_params = { 0, 0 }; } context().hooks().run_hook("NormalKey", key_to_str(key), context());