diff options
| author | Maxime Coste <mawww@kakoune.org> | 2018-05-15 07:44:18 +1000 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2018-07-05 07:54:28 +1000 |
| commit | 5902c7b7905ae600481a2920265b7668cbc8a476 (patch) | |
| tree | 76a54d877cb391d13df406bc9a854561e9c770e0 /src | |
| parent | ec1696960982464ead78efcaa0406c71d8acc12d (diff) | |
Do not save any registers by default in evaluate-commands
Diffstat (limited to 'src')
| -rw-r--r-- | src/commands.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/commands.cc b/src/commands.cc index 1cf8acdd..a169fee4 100644 --- a/src/commands.cc +++ b/src/commands.cc @@ -1577,7 +1577,7 @@ const ParameterDesc context_wrap_params = { }; template<typename Func> -void context_wrap(const ParametersParser& parser, Context& context, Func func) +void context_wrap(const ParametersParser& parser, Context& context, StringView default_saved_regs, Func func) { if ((int)(bool)parser.get_switch("buffer") + (int)(bool)parser.get_switch("client") + @@ -1601,7 +1601,7 @@ void context_wrap(const ParametersParser& parser, Context& context, Func func) }); }; Vector<decltype(make_register_restorer(0))> saved_registers; - for (auto c : parser.get_switch("save-regs").value_or("/\"|^@")) + for (auto c : parser.get_switch("save-regs").value_or(default_saved_regs)) saved_registers.push_back(make_register_restorer(c)); if (auto bufnames = parser.get_switch("buffer")) @@ -1728,7 +1728,7 @@ const CommandDesc exec_string_cmd = { CommandCompleter{}, [](const ParametersParser& parser, Context& context, const ShellContext&) { - context_wrap(parser, context, [](const ParametersParser& parser, Context& context) { + context_wrap(parser, context, "/\"|^@", [](const ParametersParser& parser, Context& context) { KeyList keys; for (auto& param : parser) { @@ -1752,7 +1752,7 @@ const CommandDesc eval_string_cmd = { CommandCompleter{}, [](const ParametersParser& parser, Context& context, const ShellContext& shell_context) { - context_wrap(parser, context, [&](const ParametersParser& parser, Context& context) { + context_wrap(parser, context, {}, [&](const ParametersParser& parser, Context& context) { CommandManager::instance().execute(join(parser, ' ', false), context, shell_context); }); } |
