diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2012-11-12 19:59:25 +0100 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2012-11-12 19:59:25 +0100 |
| commit | 801f4e740c2de6676d0f9fa41c58e41adfa99c8f (patch) | |
| tree | 9efa7cb1eeec5ebb4ce118be380c60feeacf90d4 /src/commands.cc | |
| parent | 41b5336296d9259d34c7e9a1b30b963fa1d7a5f2 (diff) | |
Add jump list support to context
jump forward is bound to ctrl-i
jump backward is bound to ctrl-o
switch buffers or jumping somewhere in the buffer push the current
position to the jump list.
when a buffer is deleted, all entries referencing it in jump lists
are erased.
Diffstat (limited to 'src/commands.cc')
| -rw-r--r-- | src/commands.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/commands.cc b/src/commands.cc index 55fcf2ff..899b4fd4 100644 --- a/src/commands.cc +++ b/src/commands.cc @@ -283,6 +283,9 @@ void edit(const CommandParameters& params, Context& context) BufferManager::instance().set_last_used_buffer(*buffer); + if (buffer != &context.buffer() or param_count > 1) + context.push_jump(); + if (buffer != &context.buffer()) { auto& manager = ClientManager::instance(); @@ -385,6 +388,7 @@ void show_buffer(const 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)); } |
