summaryrefslogtreecommitdiff
path: root/src/normal.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/normal.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/normal.cc')
-rw-r--r--src/normal.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/normal.cc b/src/normal.cc
index 08ce028d..01f56a01 100644
--- a/src/normal.cc
+++ b/src/normal.cc
@@ -1016,7 +1016,7 @@ void select_regex(Context& context, NormalParams params)
RegisterManager::instance()[reg].restore(context, saved_reg);
if (event == PromptEvent::Abort)
return;
- if (not context.history_disabled())
+ if (not context.noninteractive())
RegisterManager::instance()[reg].set(context, ex.str());
auto& selections = context.selections();
@@ -1038,7 +1038,7 @@ void split_regex(Context& context, NormalParams params)
RegisterManager::instance()[reg].restore(context, saved_reg);
if (event == PromptEvent::Abort)
return;
- if (not context.history_disabled())
+ if (not context.noninteractive())
RegisterManager::instance()[reg].set(context, ex.str());
auto& selections = context.selections();
@@ -1142,7 +1142,7 @@ void keep(Context& context, NormalParams params)
RegisterManager::instance()[reg].restore(context, saved_reg);
if (event == PromptEvent::Abort)
return;
- if (not context.history_disabled())
+ if (not context.noninteractive())
RegisterManager::instance()[reg].set(context, regex.str());
if (regex.empty() or regex.str().empty())
@@ -2049,7 +2049,7 @@ void exec_user_mappings(Context& context, NormalParams params)
return;
ScopedSetBool disable_keymaps(context.keymaps_disabled());
- ScopedSetBool disable_history(context.history_disabled());
+ ScopedSetBool noninteractive(context.noninteractive());
InputHandler::ScopedForceNormal force_normal{context.input_handler(), params};