goto_window_* extends selection (#3985)

* goto_window_* extends selection

* Don't push to the jumplist
This commit is contained in:
greg-enbala 2022-10-03 10:55:26 -04:00 committed by GitHub
parent b9ff5d0e0a
commit 63ff9309ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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) {