on master help sign in
Merge `x` and `X`
commitf41688d960ef89c29c4a51c872b8406fb8f81a85 authorBlaž Hrastnik <blaz@mxxn.io> dateSun 20 Jun 2021, 23:37 (5 years ago) parentffb54b4
3 files changed+3−21
book/src/keymap.md+2−3 helix-term/src/commands.rs−15 helix-term/src/keymap.rs+1−3
book/src/keymap.md+2−3
@@ -69,9 +69,8 @@
6969| `;` | Collapse selection onto a single cursor |
7070| `Alt-;` | Flip selection cursor and anchor |
7171| `%` | Select entire file |
72−| `x` | Select current line |
73−| `X` | Extend to next line |
74−| `[` | Expand selection to parent syntax node TODO: pick a key |
72+| `x` | Select current line, if already selected, extend to next line |
73+| `` | Expand selection to parent syntax node TODO: pick a key |
7574| `J` | join lines inside selection |
7675| `K` | keep selections matching the regex TODO: overlapped by hover help |
7776| `Space` | keep only the primary selection TODO: overlapped by space mode |
helix-term/src/commands.rs−15
@@ -888,21 +888,6 @@ fn search_selection(cx: &mut Context) {
888888
889889//
890890
891−fn select_line(cx: &mut Context) {
892− let count = cx.count();
893− let (view, doc) = current!(cx.editor);
894−
895− let pos = doc.selection(view.id).primary();
896− let text = doc.text();
897−
898− let line = text.char_to_line(pos.head);
899− let start = text.line_to_char(line);
900− let end = text
901− .line_to_char(std::cmp::min(doc.text().len_lines(), line + count))
902− .saturating_sub(1);
903−
904− doc.set_selection(view.id, Selection::single(start, end));
905−}
906891fn extend_line(cx: &mut Context) {
907892 let count = cx.count();
908893 let (view, doc) = current!(cx.editor);
helix-term/src/keymap.rs+1−3
@@ -196,9 +196,7 @@ impl Default for Keymaps {
196196 key!(';') => Command::collapse_selection,
197197 alt!(';') => Command::flip_selections,
198198 key!('%') => Command::select_all,
199− key!('x') => Command::select_line,
200− key!('X') => Command::extend_line,
201− // or select mode X?
199+ key!('x') => Command::extend_line,
202200 // extend_to_whole_line, crop_to_whole_line
203201
204202