diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2013-10-02 18:48:50 +0100 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2013-10-02 18:49:06 +0100 |
| commit | 6331fb5a61a7631fa217edde277e6e091762ec3f (patch) | |
| tree | 8d238ebebd84349f5efa885854170f4fe60d8574 /src | |
| parent | 307fc228d2f702e94dbb94dcb74330eeee037bc1 (diff) | |
Add <c-s> for saving current selection in the jump list
Diffstat (limited to 'src')
| -rw-r--r-- | src/context.cc | 6 | ||||
| -rw-r--r-- | src/normal.cc | 8 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/context.cc b/src/context.cc index f81d2b9e..c36984e6 100644 --- a/src/context.cc +++ b/src/context.cc @@ -108,6 +108,12 @@ const DynamicSelectionList& Context::jump_forward() const DynamicSelectionList& Context::jump_backward() { + if (m_current_jump != m_jump_list.end() and + *m_current_jump != editor().selections()) + { + push_jump(); + return *--m_current_jump; + } if (m_current_jump != m_jump_list.begin()) { if (m_current_jump == m_jump_list.end()) diff --git a/src/normal.cc b/src/normal.cc index 5cb99648..768801c4 100644 --- a/src/normal.cc +++ b/src/normal.cc @@ -746,6 +746,13 @@ void jump(Context& context) context.editor().select(SelectionList{ jump }); } +void save_selections(Context& context) +{ + context.push_jump(); + context.print_status({ "saved " + to_string(context.editor().selections().size()) + + " selections", get_color("Information") }); +} + template<bool insert_at_begin> void align(Context& context) { @@ -941,6 +948,7 @@ KeyMap keymap = { { Key::Modifiers::Control, 'i' }, jump<Forward> }, { { Key::Modifiers::Control, 'o' }, jump<Backward> }, + { { Key::Modifiers::Control, 's' }, save_selections }, { { Key::Modifiers::Alt, 'r' }, rotate_selections }, |
