diff options
| author | Can Celik <ogulcancelik@gmail.com> | 2026-09-13 23:05:30 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-13 23:05:30 +0300 |
| commit | f8e59221cbe5117f8f691a36affa374f5a986a9f (patch) | |
| tree | 3b2792683eff251b061fbbad7343ecffafe91aab /vendor/libghostty-vt/src/terminal/c/selection.zig | |
| parent | 59167658455442ffd2cd5b72a0fa81bcc4bcdf9e (diff) | |
feat: add ctrl-hover highlighting and fix wrapped links (#4074)
refs #1282
Diffstat (limited to 'vendor/libghostty-vt/src/terminal/c/selection.zig')
| -rw-r--r-- | vendor/libghostty-vt/src/terminal/c/selection.zig | 27 |
1 files changed, 27 insertions, 0 deletions
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, |
