summaryrefslogtreecommitdiff
path: root/src/input_handler.cc
diff options
context:
space:
mode:
authorJohannes Altmanninger <aclopte@gmail.com>2022-07-31 20:48:38 +0200
committerJohannes Altmanninger <aclopte@gmail.com>2023-06-17 11:21:16 +0200
commit00490cd08427250aaabc4fca791d8c0381b95fde (patch)
tree35d7ca14ab3e30c5e46ad4cc2efbac6018bfbb6b /src/input_handler.cc
parent7027cccf822148463eed4de1ad9240fd3526ae8b (diff)
Rename "disable_history" stack state to "noninteractive"
The commit after next will fix a bug where we wrongly disable prompt history in some scenarios. The root cause is that life span of "disable_history" does not model when we actually want to disable history. Let's rename the state variable to "noninteractive". It's set whenever we are executing a hook, mapping or command. Note that it's also active inside ":prompt"'s callback, which doesn't play well with the new name :(
Diffstat (limited to 'src/input_handler.cc')
-rw-r--r--src/input_handler.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/input_handler.cc b/src/input_handler.cc
index a36d13f1..4e953738 100644
--- a/src/input_handler.cc
+++ b/src/input_handler.cc
@@ -1197,7 +1197,7 @@ private:
void history_push(StringView entry)
{
- if (entry.empty() or context().history_disabled() or
+ if (entry.empty() or context().noninteractive() or
(m_flags & PromptFlags::DropHistoryEntriesWithBlankPrefix and
is_horizontal_blank(entry[0_byte])))
return;
@@ -1772,7 +1772,7 @@ void InputHandler::handle_key(Key key)
KeymapManager& keymaps = m_context.keymaps();
if (keymaps.is_mapped(key, keymap_mode) and not m_context.keymaps_disabled())
{
- ScopedSetBool disable_history{context().history_disabled()};
+ ScopedSetBool noninteractive{context().noninteractive()};
for (auto& k : keymaps.get_mapping_keys(key, keymap_mode))
process_key(k);