diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2016-08-27 11:19:07 +0100 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2016-08-27 11:20:38 +0100 |
| commit | b934bcd4e19f0ae3f740f9cc293b8c662aa1e1d0 (patch) | |
| tree | 8c58676c228c6ef0e8fd9e935cda530b21d37ee6 /src/normal.cc | |
| parent | 093d3bd0dfa766007d0efae414f1b464d7b2a189 (diff) | |
Support merging consecutive selections with <a-m>
Fixes #773
Diffstat (limited to 'src/normal.cc')
| -rw-r--r-- | src/normal.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/normal.cc b/src/normal.cc index 117d681c..00250c2c 100644 --- a/src/normal.cc +++ b/src/normal.cc @@ -1590,6 +1590,12 @@ void ensure_forward(Context& context, NormalParams) context.selections().check_invariant(); } +void merge_consecutive(Context& context, NormalParams params) +{ + ensure_forward(context, params); + context.selections().merge_consecutive(); +} + void force_redraw(Context& context, NormalParams) { if (context.has_client()) @@ -1663,6 +1669,7 @@ static NormalCmdDesc cmds[] = { ';', "reduce selections to their cursor", clear_selections }, { alt(';'), "swap selections cursor and anchor", flip_selections }, { alt(':'), "ensure selection cursor is after anchor", ensure_forward }, + { alt('m'), "merge consecutive selections", merge_consecutive }, { 'w', "select to next word start", repeated<&select<SelectMode::Replace, select_to_next_word<Word>>> }, { 'e', "select to next word end", repeated<select<SelectMode::Replace, select_to_next_word_end<Word>>> }, |
