Skip to content

Commit

Permalink
goto_window_* extends selection (helix-editor#3985)
Browse files Browse the repository at this point in the history
* goto_window_* extends selection

* Don't push to the jumplist
  • Loading branch information
greg-enbala authored and Shekhinah Memmel committed Dec 11, 2022
1 parent da6959a commit af09cbb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions helix-term/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -888,8 +888,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) {
Expand Down

0 comments on commit af09cbb

Please sign in to comment.