feat: add multi cursor support to delete_line

This commit is contained in:
CJ van den Berg 2025-10-30 11:16:07 +01:00
parent dff0b233d1
commit c27795bc95

View file

@ -3033,9 +3033,11 @@ pub const Editor = struct {
pub fn delete_line(self: *Self, _: Context) Result { pub fn delete_line(self: *Self, _: Context) Result {
const b = try self.buf_for_update(); const b = try self.buf_for_update();
const primary = self.get_primary(); var root = b.root;
try self.select_line_at_cursor(b.root, primary, .include_eol); for (self.cursels.items) |*cursel_| if (cursel_.*) |*cursel| {
const root = try self.delete_selection(b.root, primary, b.allocator); try self.select_line_at_cursor(root, cursel, .include_eol);
root = try self.delete_selection(root, cursel, b.allocator);
};
try self.update_buf(root); try self.update_buf(root);
self.clamp(); self.clamp();
} }