summaryrefslogtreecommitdiff
path: root/src/normal.cc
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2018-02-24 19:58:40 +1100
committerMaxime Coste <mawww@kakoune.org>2018-02-24 19:58:40 +1100
commitefce8e0ce66edd1b29dbe91f1e2d5b2c219f1dd3 (patch)
treeaeb6afe70ed39514a0ba3083ca40cf2f96f6dade /src/normal.cc
parent4d11bb20c342ae4a2c2903a8faf8786e39ae2eec (diff)
Revert "Do not save last command/pipe/regex in register when history is disabled"
This reverts commit 55621fb4cc9c01972317182dd6a8ed3ced0e1f9e. This should not be necessary as :exec/eval already save those registers and reset them by default, and it breaks the ability to use those registers during an eval/exec (as the commands behave differently)
Diffstat (limited to 'src/normal.cc')
-rw-r--r--src/normal.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/normal.cc b/src/normal.cc
index bd07826c..5a631e76 100644
--- a/src/normal.cc
+++ b/src/normal.cc
@@ -449,7 +449,7 @@ void command(Context& context, NormalParams params)
{
if (cmdline.empty())
cmdline = context.main_sel_register_value(':');
- else if (not is_blank(cmdline[0]) and not context.history_disabled())
+ else if (not is_blank(cmdline[0]))
RegisterManager::instance()[':'].set(context, cmdline.str());
EnvVarMap env_vars = {
@@ -509,7 +509,7 @@ void pipe(Context& context, NormalParams)
if (cmdline.empty())
cmdline = context.main_sel_register_value("|");
- else if (not context.history_disabled())
+ else
RegisterManager::instance()['|'].set(context, cmdline.str());
if (cmdline.empty())
@@ -584,7 +584,7 @@ void insert_output(Context& context, NormalParams)
if (cmdline.empty())
cmdline = context.main_sel_register_value("|");
- else if (not context.history_disabled())
+ else
RegisterManager::instance()['|'].set(context, cmdline.str());
if (cmdline.empty())
@@ -765,7 +765,8 @@ void search(Context& context, NormalParams params)
const char reg = to_lower(params.reg ? params.reg : '/');
const int count = params.count;
- auto saved_reg = RegisterManager::instance()[reg].get(context) | gather<Vector<String>>();
+ auto reg_content = RegisterManager::instance()[reg].get(context);
+ Vector<String> saved_reg{reg_content.begin(), reg_content.end()};
const int main_index = std::min(context.selections().main_index(), saved_reg.size()-1);
regex_prompt<direction>(context, prompt.str(), saved_reg[main_index],
@@ -776,8 +777,7 @@ void search(Context& context, NormalParams params)
RegisterManager::instance()[reg].set(context, saved_reg);
return;
}
- if (not context.history_disabled())
- RegisterManager::instance()[reg].set(context, regex.str());
+ RegisterManager::instance()[reg].set(context, regex.str());
if (regex.empty() or regex.str().empty())
return;