From c0973075fafc7003be1028922bf99a2c48bcdcd6 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Fri, 20 Dec 2013 20:10:08 +0000 Subject: Get rid of Editor for good ClientManager now stores only the free windows, clients take ownership of its own. --- src/normal.cc | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/normal.cc') diff --git a/src/normal.cc b/src/normal.cc index 175173c0..e612f6f7 100644 --- a/src/normal.cc +++ b/src/normal.cc @@ -285,8 +285,7 @@ void goto_commands(Context& context, int line) if (it->get() == &buffer and ++it == buffer_manager.end()) break; context.push_jump(); - auto& client_manager = ClientManager::instance(); - context.change_editor(client_manager.get_unused_window_for_buffer(**it)); + context.change_buffer(**it); break; } case 'f': @@ -894,7 +893,7 @@ void scroll(Context& context, int) auto cursor_pos = utf8::advance(buffer.iterator_at(position.line), buffer.iterator_at(position.line+1), position.column); - select_coord(buffer, cursor_pos.coord(), window.selections()); + select_coord(buffer, cursor_pos.coord(), context.selections()); window.set_position(position); } @@ -985,10 +984,7 @@ void jump(Context& context, int) Buffer& buffer = const_cast(jump.buffer()); BufferManager::instance().set_last_used_buffer(buffer); if (&buffer != &context.buffer()) - { - auto& manager = ClientManager::instance(); - context.change_editor(manager.get_unused_window_for_buffer(buffer)); - } + context.change_buffer(buffer); context.selections() = jump; } -- cgit v1.2.3