mirror of
https://github.com/ilyakooo0/helix.git
synced 2024-12-01 11:23:10 +03:00
mouse operations respect scrolloff (#5255)
This commit is contained in:
parent
1107296ca9
commit
df1830ef28
@ -1155,6 +1155,7 @@ impl EditorView {
|
||||
}
|
||||
|
||||
editor.focus(view_id);
|
||||
editor.ensure_cursor_in_view(view_id);
|
||||
|
||||
return EventResult::Consumed(None);
|
||||
}
|
||||
@ -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)
|
||||
}
|
||||
|
||||
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user