diff --git a/src/client.cc b/src/client.cc index 7eb35eee..c3218b77 100644 --- a/src/client.cc +++ b/src/client.cc @@ -64,6 +64,8 @@ DisplayLine Client::generate_mode_line() const status.push_back({ "[recording ("_str + m_input_handler.recording_reg() + ")]", info_face }); if (context().buffer().flags() & Buffer::Flags::New) status.push_back({ "[new file]", info_face }); + if (context().are_user_hooks_disabled()) + status.push_back({ "[no-hooks]", info_face }); if (context().buffer().flags() & Buffer::Flags::Fifo) status.push_back({ "[fifo]", info_face }); status.push_back({ " ", status_face }); diff --git a/src/input_handler.cc b/src/input_handler.cc index a17ef281..90e455a4 100644 --- a/src/input_handler.cc +++ b/src/input_handler.cc @@ -87,7 +87,7 @@ public: if (do_restore_hooks) { context().enable_user_hooks(); - m_disable_hooks = false; + m_hooks_disabled = false; } }); @@ -100,14 +100,14 @@ public: else if (key == Key::Backspace) m_count /= 10; else if (key == '\\') - m_disable_hooks = true; + { + m_hooks_disabled = true; + context().disable_user_hooks(); + } else { - if (m_disable_hooks) - { - context().disable_user_hooks(); + if (m_hooks_disabled) do_restore_hooks = true; - } auto it = keymap.find(key); if (it != keymap.end()) { @@ -137,7 +137,7 @@ public: private: int m_count = 0; - bool m_disable_hooks = false; + bool m_hooks_disabled = false; Timer m_idle_timer; Timer m_fs_check_timer; };