feat: add configurable word boundary characters for text selection

Add new `selection-word-chars` config option to customize which characters
mark word boundaries during text selection operations (double-click, word
selection, etc.). Similar to zsh's WORDCHARS environment variable, but
specifies boundary characters rather than word characters.

Default boundaries: ` \t'"│`|:;,()[]{}<>$`

Users can now customize word selection behavior, such as treating
semicolons as part of words or excluding periods from boundaries:

    selection-word-chars = " \t'\"│`|:,()[]{}<>$"

Changes:
- Add selection-word-chars config field with comprehensive documentation
- Modify selectWord() and selectWordBetween() to accept boundary_chars parameter
- Parse UTF-8 boundary string to u32 codepoints at runtime
- Update all call sites in Surface.zig and embedded.zig
- Update all test cases to pass boundary characters
This commit is contained in:
mauroporras
2025-10-24 15:37:21 -05:00
committed by Mitchell Hashimoto
parent 6730afe312
commit 811e3594eb
4 changed files with 103 additions and 53 deletions

View File

@@ -2165,7 +2165,10 @@ pub const CAPI = struct {
if (comptime std.debug.runtime_safety) unreachable;
return false;
};
break :sel surface.io.terminal.screens.active.selectWord(pin) orelse return false;
break :sel surface.io.terminal.screens.active.selectWord(
pin,
surface.config.selection_word_chars,
) orelse return false;
};
// Read the selection