diff --git a/src/tui/editor.zig b/src/tui/editor.zig index 3cf398f..db5a46f 100644 --- a/src/tui/editor.zig +++ b/src/tui/editor.zig @@ -242,6 +242,16 @@ pub const CurSel = struct { return false; return self.cursor.nudge_delete(nudge); } + + fn merge(self: *Self, other: Selection) bool { + if (self.selection) |*sel_| { + if (sel_.merge(other)) { + self.cursor = sel_.end; + return true; + } + } + return self.cursor.within(other); + } }; pub const Diagnostic = struct {