mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-19 05:50:27 +00:00
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:
committed by
Mitchell Hashimoto
parent
6730afe312
commit
811e3594eb
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user