goto_window_* extends selection (#3985)

* goto_window_* extends selection

* Don't push to the jumplist
pull/1/head
greg-enbala 2 years ago committed by GitHub
parent b9ff5d0e0a
commit 63ff9309ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -885,8 +885,12 @@ fn goto_window(cx: &mut Context, align: Align) {
.min(last_line.saturating_sub(scrolloff)); .min(last_line.saturating_sub(scrolloff));
let pos = doc.text().line_to_char(line); let pos = doc.text().line_to_char(line);
let text = doc.text().slice(..);
doc.set_selection(view.id, Selection::point(pos)); 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) { fn goto_window_top(cx: &mut Context) {

Loading…
Cancel
Save