diff options
| author | Gabriel Schneider <[email protected]> | 2026-08-18 12:09:12 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-08-18 23:45:25 -0300 |
| commit | c24a9e40215bc30c68c9db7675f1c6a07d9bbae3 (patch) | |
| tree | 9afdb1f3d128bda3f3cf4837c2893982b0a8f69c /src/config.zig | |
| parent | 31fece62f56aa2311e2325de83659edbc9e641db (diff) | |
| download | pardes-c24a9e40215bc30c68c9db7675f1c6a07d9bbae3.tar.gz pardes-c24a9e40215bc30c68c9db7675f1c6a07d9bbae3.zip | |
modal + file_pane: rework editing math and pane behavior, config/syntax additions, unit tests
Diffstat (limited to 'src/config.zig')
| -rw-r--r-- | src/config.zig | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/config.zig b/src/config.zig index 9f18f75e..f58716e5 100644 --- a/src/config.zig +++ b/src/config.zig @@ -581,7 +581,10 @@ pub const MINH: u16 = 3; /// definition of "the word under the cursor" for Look, Execute, the tag chord /// and every search result row. pub fn isFileChar(c: u8) bool { - return std.ascii.isAlphanumeric(c) or switch (c) { + // Non-ASCII bytes belong to their UTF-8 word as a unit. Bounds are byte + // offsets, so accepting every high byte keeps Unicode paths/identifiers + // intact instead of returning a slice through one codepoint. + return c >= 0x80 or std.ascii.isAlphanumeric(c) or switch (c) { '.', '-', '+', '/', ':', '@', '_', '~' => true, else => false, }; @@ -677,7 +680,7 @@ pub const image_exts = [_][]const u8{ ".png", ".jpg", ".jpeg", ".gif", ".bmp", " /// token for them would be a divergence nothing asked for. pub const comment_token_default = "#"; pub const comment_tokens: []const struct { exts: []const []const u8, token: []const u8 } = &.{ - .{ .token = "//", .exts = &.{ ".zig", ".zon", ".c", ".h", ".cpp", ".cc", ".cxx", ".hpp", ".hh", ".hxx", ".rs", ".go", ".java", ".scala", ".sc", ".kt", ".kts", ".cs", ".csx", ".php", ".pas", ".pp", ".p", ".js", ".jsx", ".mjs", ".cjs", ".ts", ".tsx", ".swift", ".dart" } }, + .{ .token = "//", .exts = &.{ ".zig", ".zon", ".c", ".h", ".cpp", ".cc", ".cxx", ".hpp", ".hh", ".hxx", ".rs", ".go", ".java", ".scala", ".sc", ".kt", ".kts", ".cs", ".csx", ".php", ".pas", ".pp", ".p", ".js", ".jsx", ".mjs", ".cjs", ".ts", ".tsx", ".typ", ".typst", ".swift", ".dart" } }, .{ .token = "#", .exts = &.{ ".py", ".pyw", ".sh", ".bash", ".zsh", ".rb", ".rake", ".ex", ".exs", ".ps1", ".psm1", ".psd1", ".pl", ".pm", ".r", ".jl", ".nix", ".toml", ".yaml", ".yml", ".cmake", ".mk", ".tf" } }, .{ .token = "--", .exts = &.{ ".lua", ".hs", ".lhs", ".elm", ".sql", ".adb", ".ads", ".ada" } }, .{ .token = ";", .exts = &.{ ".clj", ".cljs", ".cljc", ".edn", ".el", ".lisp", ".scm", ".asm", ".s" } }, |
