fix: move_page_up and related functions should cancel the selection

This commit is contained in:
CJ van den Berg 2026-01-21 20:25:48 +01:00
parent f24ecdaed3
commit 89ca00ddef
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -2108,10 +2108,12 @@ pub const Editor = struct {
fn with_cursors_and_view_const(self: *Self, root: Buffer.Root, move: cursor_view_operator_const, view: *const View) error{Stop}!void { fn with_cursors_and_view_const(self: *Self, root: Buffer.Root, move: cursor_view_operator_const, view: *const View) error{Stop}!void {
var someone_stopped = false; var someone_stopped = false;
for (self.cursels.items) |*cursel_| if (cursel_.*) |*cursel| for (self.cursels.items) |*cursel_| if (cursel_.*) |*cursel| {
cursel.disable_selection(root, self.metrics);
with_cursor_and_view_const(root, move, cursel, view, self.metrics) catch { with_cursor_and_view_const(root, move, cursel, view, self.metrics) catch {
someone_stopped = true; someone_stopped = true;
}; };
};
self.collapse_cursors(); self.collapse_cursors();
return if (someone_stopped) error.Stop else {}; return if (someone_stopped) error.Stop else {};
} }