on master help sign in
goto_window_* extends selection (#3985)
63ff930greg-enbala
helix-term/src/commands.rs+6−2
@@ -885,8 +885,12 @@ fn goto_window(cx: &mut Context, align: Align) {
885 .min(last_line.saturating_sub(scrolloff));
885 .min(last_line.saturating_sub(scrolloff));
886
886
887 let pos = doc.text().line_to_char(line);
887 let pos = doc.text().line_to_char(line);
888−
888+ let text = doc.text().slice(..);
889+ let selection = doc
890+ .selection(view.id)
891+ .clone()
892+ .transform(|range| range.put_cursor(text, pos, cx.editor.mode == Mode::Select));
889− doc.set_selection(view.id, Selection::point(pos));
893+ doc.set_selection(view.id, selection);
890}
894}
891
895
892fn goto_window_top(cx: &mut Context) {
896fn goto_window_top(cx: &mut Context) {