develop helix cursor mode

This commit is contained in:
Meredith Oleander 2025-01-18 11:02:00 +11:00 committed by CJ van den Berg
parent 386094001d
commit 3e65503902
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -106,6 +106,16 @@ pub const CurSel = struct {
};
}
fn enable_selection_helix(self: *Self, root: Buffer.Root, metrics: Buffer.Metrics) *Selection {
return if (self.selection) |*sel|
sel
else cod: {
self.selection = Selection.from_cursor(&self.cursor);
try self.selection.?.end.move_right(root, metrics);
break :cod &self.selection.?;
};
}
fn check_selection(self: *Self) void {
if (self.selection) |sel| if (sel.empty()) {
self.selection = null;