diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-06-01 23:05:23 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-06-01 23:05:51 +0300 |
| commit | 5bd21b7ed468b5ff4d1a5b2ed7e211f401eb138a (patch) | |
| tree | 672fa4625cca0ecb3e9376fc7f8e33d7b0e9deef /vendor/libghostty-vt/src/config | |
| parent | 32abb3776668ee768200019c170956f67fe33a86 (diff) | |
chore: update libghostty vendor
refs #276
Diffstat (limited to 'vendor/libghostty-vt/src/config')
| -rw-r--r-- | vendor/libghostty-vt/src/config/Config.zig | 54 |
1 files changed, 24 insertions, 30 deletions
diff --git a/vendor/libghostty-vt/src/config/Config.zig b/vendor/libghostty-vt/src/config/Config.zig index 5b1d73de..66b8c605 100644 --- a/vendor/libghostty-vt/src/config/Config.zig +++ b/vendor/libghostty-vt/src/config/Config.zig @@ -49,6 +49,7 @@ const string = @import("string.zig"); const terminal = struct { const CursorStyle = @import("../terminal/cursor.zig").Style; const color = @import("../terminal/color.zig"); + const selection_codepoints = @import("../terminal/selection_codepoints.zig"); const style = @import("../terminal/style.zig"); const x11_color = @import("../terminal/x11_color.zig"); }; @@ -751,12 +752,12 @@ foreground: Color = .{ .r = 0xFF, .g = 0xFF, .b = 0xFF }, /// The null character (U+0000) is always treated as a boundary and does not /// need to be included in this configuration. /// -/// Default: `` \t'"│`|:;,()[]{}<>$ `` +/// Default: ``\t '"│`|:;,()[]{}<>$`` /// /// To add or remove specific characters, you can set this to a custom value. /// For example, to treat semicolons as part of words: /// -/// selection-word-chars = " \t'\"│`|:,()[]{}<>$" +/// selection-word-chars = "\t '\"│`|:,()[]{}<>$" /// /// Available since: 1.3.0 @"selection-word-chars": SelectionWordChars = .{}, @@ -2880,9 +2881,16 @@ keybind: Keybinds = .{}, /// command-palette-entry = title:"Ghostty",description:"Add a little Ghostty to your terminal.",action:"text:\xf0\x9f\x91\xbb" /// ``` /// +/// There are some additional special values that can be specified for +/// command-palette-entry: +/// +/// * `command-palette-entry=clear` will clear all command entries. Warning: this +/// removes ALL entries up to this point, including the default +/// entries. Available since: 1.4.0 +/// /// By default, the command palette is preloaded with most actions that might /// be useful in an interactive setting yet do not have easily accessible or -/// memorizable shortcuts. The default entries can be cleared by setting this +/// memorizable shortcuts. The default entries can be restored by setting this /// setting to an empty value: /// /// ```ini @@ -6142,32 +6150,8 @@ pub const RepeatableString = struct { pub const SelectionWordChars = struct { const Self = @This(); - /// Default boundary characters: ` \t'"│`|:;,()[]{}<>$` - const default_codepoints = [_]u21{ - 0, // null - ' ', // space - '\t', // tab - '\'', // single quote - '"', // double quote - '│', // U+2502 box drawing - '`', // backtick - '|', // pipe - ':', // colon - ';', // semicolon - ',', // comma - '(', // left paren - ')', // right paren - '[', // left bracket - ']', // right bracket - '{', // left brace - '}', // right brace - '<', // less than - '>', // greater than - '$', // dollar - }; - /// The parsed codepoints. Always includes null (U+0000) at index 0. - codepoints: []const u21 = &default_codepoints, + codepoints: []const u21 = &terminal.selection_codepoints.default_word_boundaries, pub fn parseCLI(self: *Self, alloc: Allocator, input: ?[]const u8) !void { const value = input orelse return error.ValueRequired; @@ -8736,6 +8720,13 @@ pub const RepeatableCommand = struct { // Unset or empty input clears the list const input = input_ orelse ""; if (input.len == 0) { + log.info("config has 'command-palette-entry =', using default entries", .{}); + try self.init(alloc); + return; + } + + if (std.mem.eql(u8, input, "clear")) { + log.info("config has 'command-palette-entry = clear', all command entries cleared", .{}); self.value.clearRetainingCapacity(); self.value_c.clearRetainingCapacity(); return; @@ -8847,8 +8838,11 @@ pub const RepeatableCommand = struct { try testing.expectEqualStrings("Baz", list.value.items[3].title); try testing.expectEqualStrings("Raspberry Pie", list.value.items[3].description); - try list.parseCLI(alloc, ""); + try list.parseCLI(alloc, "clear"); try testing.expectEqual(@as(usize, 0), list.value.items.len); + + try list.parseCLI(alloc, ""); + try testing.expectEqual(inputpkg.command.defaults.len, list.value.items.len); } test "RepeatableCommand formatConfig empty" { @@ -8963,7 +8957,7 @@ pub const RepeatableCommand = struct { try list.parseCLI(alloc, "title:Foo,action:ignore"); try testing.expectEqual(@as(usize, 1), list.cval().len); - try list.parseCLI(alloc, ""); + try list.parseCLI(alloc, "clear"); try testing.expectEqual(@as(usize, 0), list.cval().len); } }; |
