summaryrefslogtreecommitdiff
path: root/src/normal.cc
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2013-12-20 20:10:08 +0000
committerMaxime Coste <frrrwww@gmail.com>2013-12-20 20:14:57 +0000
commitc0973075fafc7003be1028922bf99a2c48bcdcd6 (patch)
tree303d3d6b03942857775f7c0d2e15d621a6f6df37 /src/normal.cc
parentcb324a4b8842d6d45a7dba316cd4f909addb99c2 (diff)
Get rid of Editor for good
ClientManager now stores only the free windows, clients take ownership of its own.
Diffstat (limited to 'src/normal.cc')
-rw-r--r--src/normal.cc10
1 files changed, 3 insertions, 7 deletions
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<Buffer&>(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;
}