From 9e08cf8ea4d10aa13b90ef05a80367d0165bffe3 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 26 Nov 2015 13:32:29 +0000 Subject: [PATCH] Preserve default registers in exec/eval by default --- src/commands.cc | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/commands.cc b/src/commands.cc index ddaee769..ab19ef8e 100644 --- a/src/commands.cc +++ b/src/commands.cc @@ -1266,11 +1266,8 @@ void context_wrap(const ParametersParser& parser, Context& context, Func func) const bool disable_keymaps = not parser.get_switch("with-maps"); Vector saved_registers; - if (auto regs = parser.get_switch("save-regs")) - { - for (auto& r : *regs) - saved_registers.emplace_back(r, context); - } + for (auto& r : parser.get_switch("save-regs").value_or("/\"|^@")) + saved_registers.emplace_back(r, context); ClientManager& cm = ClientManager::instance(); if (auto bufnames = parser.get_switch("buffer")) @@ -1699,9 +1696,6 @@ const CommandDesc change_working_directory_cmd = { void exec_keys(ConstArrayView keys, Context& context) { - RegisterRestorer quote('"', context); - RegisterRestorer slash('/', context); - ScopedEdition edition(context); for (auto& key : keys)