aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src
diff options
context:
space:
mode:
Diffstat (limited to 'helix-term/src')
-rw-r--r--helix-term/src/commands.rs8
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) {