diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2013-12-20 20:10:08 +0000 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2013-12-20 20:14:57 +0000 |
| commit | c0973075fafc7003be1028922bf99a2c48bcdcd6 (patch) | |
| tree | 303d3d6b03942857775f7c0d2e15d621a6f6df37 /src/commands.cc | |
| parent | cb324a4b8842d6d45a7dba316cd4f909addb99c2 (diff) | |
Get rid of Editor for good
ClientManager now stores only the free windows, clients take
ownership of its own.
Diffstat (limited to 'src/commands.cc')
| -rw-r--r-- | src/commands.cc | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/commands.cc b/src/commands.cc index 21dce82f..d538ebf8 100644 --- a/src/commands.cc +++ b/src/commands.cc @@ -116,10 +116,7 @@ void edit(CommandParameters params, Context& context) context.push_jump(); if (buffer != &context.buffer()) - { - auto& manager = ClientManager::instance(); - context.change_editor(manager.get_unused_window_for_buffer(*buffer)); - } + context.change_buffer(*buffer); if (param_count > 1 and not parser[1].empty()) { @@ -210,8 +207,7 @@ void show_buffer(CommandParameters params, Context& context) if (&buffer != &context.buffer()) { context.push_jump(); - auto& manager = ClientManager::instance(); - context.change_editor(manager.get_unused_window_for_buffer(buffer)); + context.change_buffer(buffer); } } @@ -568,9 +564,7 @@ void context_wrap(CommandParameters params, Context& context, Func func) if (parser.has_option("draft")) { - 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); }); + InputHandler input_handler(real_context->buffer(), real_context->selections(), real_context->name()); // We do not want this draft context to commit undo groups if the real one is // going to commit the whole thing later @@ -579,6 +573,7 @@ void context_wrap(CommandParameters params, Context& context, Func func) if (parser.has_option("itersel")) { + DynamicSelectionList sels{real_context->buffer(), real_context->selections()}; for (auto& sel : sels) { input_handler.context().selections() = sel; |
