From f8e59221cbe5117f8f691a36affa374f5a986a9f Mon Sep 17 00:00:00 2001 From: Can Celik Date: Sun, 13 Sep 2026 23:05:30 +0300 Subject: feat: add ctrl-hover highlighting and fix wrapped links (#4074) refs #1282 --- vendor/libghostty-vt/src/terminal/c/selection.zig | 27 +++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'vendor/libghostty-vt/src/terminal/c/selection.zig') diff --git a/vendor/libghostty-vt/src/terminal/c/selection.zig b/vendor/libghostty-vt/src/terminal/c/selection.zig index 2830149f..63873bed 100644 --- a/vendor/libghostty-vt/src/terminal/c/selection.zig +++ b/vendor/libghostty-vt/src/terminal/c/selection.zig @@ -110,6 +110,33 @@ pub fn word( return .success; } +pub fn word_bounded( + terminal: terminal_c.Terminal, + options: ?*const SelectWordOptions, + max_cells: usize, + out_selection: ?*CSelection, +) callconv(lib.calling_conv) Result { + const t = terminal_c.zigTerminal(terminal) orelse return .invalid_value; + const opts = options orelse return .invalid_value; + if (opts.size < @sizeOf(SelectWordOptions)) return .invalid_value; + const out = out_selection orelse return .invalid_value; + + const boundary_codepoints = codepointSlice( + opts.boundary_codepoints, + opts.boundary_codepoints_len, + ) catch return .invalid_value; + + const screen = t.screens.active; + const pin = opts.ref.toPin() orelse return .invalid_value; + out.* = .fromZig(screen.selectWordBounded( + pin, + boundary_codepoints orelse &selection_codepoints.default_word_boundaries, + max_cells, + ) orelse + return .no_value); + return .success; +} + pub fn word_between( terminal: terminal_c.Terminal, options: ?*const SelectWordBetweenOptions, -- cgit v1.2.3