diff options
author | greg-enbala | 2022-10-03 14:55:26 +0000 |
---|---|---|
committer | GitHub | 2022-10-03 14:55:26 +0000 |
commit | 63ff9309cee6c5a8b361f2e56f0f69228aa1f1b3 (patch) | |
tree | 1e5869b7315793f0c2d6fcf95458b29999138a8c /helix-term/src | |
parent | b9ff5d0e0a8a0cc17082dede2f662eb35c7a5815 (diff) |
goto_window_* extends selection (#3985)
* goto_window_* extends selection
* Don't push to the jumplist
Diffstat (limited to 'helix-term/src')
-rw-r--r-- | helix-term/src/commands.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index cb561d6d..fc5c2063 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -885,8 +885,12 @@ fn goto_window(cx: &mut Context, align: Align) { .min(last_line.saturating_sub(scrolloff)); let pos = doc.text().line_to_char(line); - - doc.set_selection(view.id, Selection::point(pos)); + let text = doc.text().slice(..); + let selection = doc + .selection(view.id) + .clone() + .transform(|range| range.put_cursor(text, pos, cx.editor.mode == Mode::Select)); + doc.set_selection(view.id, selection); } fn goto_window_top(cx: &mut Context) { |