refactor: nudge tabstops

This commit is contained in:
CJ van den Berg 2025-12-09 20:16:38 +01:00
parent b472300b3d
commit 4a44838b88
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -2198,6 +2198,8 @@ pub const Editor = struct {
cursel.nudge_insert(nudge);
for (self.matches.items) |*match_| if (match_.*) |*match|
match.nudge_insert(nudge);
for (self.cursels_tabstops.items) |tabstop| for (tabstop) |*cursel|
cursel.nudge_insert(nudge);
}
fn nudge_delete(self: *Self, nudge: Selection, exclude: *const CurSel, _: usize) void {
@ -2210,6 +2212,11 @@ pub const Editor = struct {
if (!match.nudge_delete(nudge)) {
self.matches.items[i] = null;
};
for (self.cursels_tabstops.items) |tabstop| for (tabstop) |*cursel|
if (!cursel.nudge_delete(nudge)) {
self.cancel_all_tabstops();
break;
};
}
pub fn delete_selection(self: *Self, root: Buffer.Root, cursel: *CurSel, allocator: Allocator) error{Stop}!Buffer.Root {