diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2016-06-20 19:40:49 +0100 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2016-06-20 19:40:49 +0100 |
| commit | fef37e6a92b3ad0b438e0e40c575ccdeaf37d54c (patch) | |
| tree | d069765cd86f0ff314049f3a6dd44cd6da4981a3 /src | |
| parent | 6e0279856f196cc99d72bfc85e5768ef5871b674 (diff) | |
Do not preserve registers by default when exec/eval in a non draft context
Fixes #700
Diffstat (limited to 'src')
| -rw-r--r-- | src/commands.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/commands.cc b/src/commands.cc index 8f552170..5070aa9a 100644 --- a/src/commands.cc +++ b/src/commands.cc @@ -1395,8 +1395,10 @@ void context_wrap(const ParametersParser& parser, Context& context, Func func) const bool no_hooks = parser.get_switch("no-hooks") or context.user_hooks_disabled(); const bool no_keymaps = not parser.get_switch("with-maps"); + const bool save_regs_by_default = (bool)parser.get_switch("draft") or + (bool)parser.get_switch("buffer"); Vector<RegisterRestorer> saved_registers; - for (auto& r : parser.get_switch("save-regs").value_or("/\"|^@")) + for (auto& r : parser.get_switch("save-regs").value_or(save_regs_by_default ? "/\"|^@" : "")) saved_registers.emplace_back(r, context); ClientManager& cm = ClientManager::instance(); |
