diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2013-12-16 23:51:57 +0000 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2013-12-16 23:51:57 +0000 |
| commit | d9c3de3fc0d4581a7a1783693bc3f16e260e052d (patch) | |
| tree | b1161de64ef0762c99918578421048bb4bfbc5b1 /src/commands.cc | |
| parent | d1ac813f61e4f9e78077c43f8bf5bbda9dcef55f (diff) | |
small cleanup in context_wrap
Diffstat (limited to 'src/commands.cc')
| -rw-r--r-- | src/commands.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/commands.cc b/src/commands.cc index dc798f86..21dce82f 100644 --- a/src/commands.cc +++ b/src/commands.cc @@ -568,10 +568,9 @@ void context_wrap(CommandParameters params, Context& context, Func func) if (parser.has_option("draft")) { - Editor& editor = real_context->editor(); - InputHandler input_handler(editor, real_context->name()); - DynamicSelectionList sels{editor.buffer(), editor.selections()}; - auto restore_sels = on_scope_end([&]{ editor.selections() = std::move(sels); }); + InputHandler input_handler(real_context->editor(), real_context->name()); + DynamicSelectionList sels{real_context->buffer(), real_context->selections()}; + auto restore_sels = on_scope_end([&]{ real_context->selections() = std::move(sels); }); // We do not want this draft context to commit undo groups if the real one is // going to commit the whole thing later @@ -582,7 +581,7 @@ void context_wrap(CommandParameters params, Context& context, Func func) { for (auto& sel : sels) { - editor.selections() = sel; + input_handler.context().selections() = sel; func(parser, input_handler.context()); } } |
