diff options
| author | Maxime Coste <mawww@kakoune.org> | 2017-11-13 17:36:04 +0800 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2017-11-13 17:36:04 +0800 |
| commit | 706c1672d52967e7dd6ad9d92c4dfa3a6f15744e (patch) | |
| tree | 108660e69d43989ed7bb97d9afd663c8b5a47406 /src | |
| parent | 5f5188a89c8a9c120d85c59461e8c283741d6d5c (diff) | |
Normal: add <a-S> to select first and last char of selection
Fixes #550
Diffstat (limited to 'src')
| -rw-r--r-- | src/normal.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/normal.cc b/src/normal.cc index 9a407ec1..1166ae30 100644 --- a/src/normal.cc +++ b/src/normal.cc @@ -932,6 +932,19 @@ void split_lines(Context& context, NormalParams) selections = std::move(res); } +void select_boundaries(Context& context, NormalParams) +{ + auto& selections = context.selections(); + Vector<Selection> res; + for (auto& sel : selections) + { + res.push_back(sel.min()); + if (sel.min() != sel.max()) + res.push_back(sel.max()); + } + selections = std::move(res); +} + void join_lines_select_spaces(Context& context, NormalParams) { auto& buffer = context.buffer(); @@ -2011,6 +2024,7 @@ static const HashMap<Key, NormalCmd, MemoryDomain::Undefined, KeymapBackend> key { {'s'}, {"select regex matches in selected text", select_regex} }, { {'S'}, {"split selected text on regex matches", split_regex} }, { {alt('s')}, {"split selected text on line ends", split_lines} }, + { {alt('S')}, {"select selection boundaries", select_boundaries} }, { {'.'}, {"repeat last insert command", repeat_last_insert} }, { {alt('.')}, {"repeat last object select/character find", repeat_last_select} }, |
