From c27795bc958c35e472212afddff8264c474d0f2f Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Thu, 30 Oct 2025 11:16:07 +0100 Subject: [PATCH] feat: add multi cursor support to delete_line --- src/tui/editor.zig | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/tui/editor.zig b/src/tui/editor.zig index ec77cac..f8e87bc 100644 --- a/src/tui/editor.zig +++ b/src/tui/editor.zig @@ -3033,9 +3033,11 @@ pub const Editor = struct { pub fn delete_line(self: *Self, _: Context) Result { const b = try self.buf_for_update(); - const primary = self.get_primary(); - try self.select_line_at_cursor(b.root, primary, .include_eol); - const root = try self.delete_selection(b.root, primary, b.allocator); + var root = b.root; + for (self.cursels.items) |*cursel_| if (cursel_.*) |*cursel| { + try self.select_line_at_cursor(root, cursel, .include_eol); + root = try self.delete_selection(root, cursel, b.allocator); + }; try self.update_buf(root); self.clamp(); }