Skip to content

Commit

Permalink
mouse operations respect scrolloff (#5255)
Browse files Browse the repository at this point in the history
  • Loading branch information
hunterliao29 committed Dec 23, 2022
1 parent 1107296 commit df1830e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion helix-term/src/ui/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1155,6 +1155,7 @@ impl EditorView {
}

editor.focus(view_id);
editor.ensure_cursor_in_view(view_id);

return EventResult::Consumed(None);
}
Expand Down Expand Up @@ -1191,7 +1192,8 @@ impl EditorView {
let primary = selection.primary_mut();
*primary = primary.put_cursor(doc.text().slice(..), pos, true);
doc.set_selection(view.id, selection);

let view_id = view.id;
cxt.editor.ensure_cursor_in_view(view_id);
EventResult::Consumed(None)
}

Expand All @@ -1213,6 +1215,7 @@ impl EditorView {
commands::scroll(cxt, offset, direction);

cxt.editor.tree.focus = current_view;
cxt.editor.ensure_cursor_in_view(current_view);

EventResult::Consumed(None)
}
Expand Down

0 comments on commit df1830e

Please sign in to comment.