summaryrefslogtreecommitdiff
path: root/src/fs.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-22 09:50:43 -0300
committerGabriel Schneider <[email protected]>2026-10-22 10:03:24 -0300
commita8b457a306a4442975210bcac3f04b56513c61c3 (patch)
tree6e2026ecb15da2fb919a0202f5d8b38e3b36a595 /src/fs.zig
parenta8a1499bdffffc5b6919e24ec957e92fabaf003b (diff)
parent7e9d2c4169245072265b483ffaa6aa05f23f08d3 (diff)
downloadpardes-a8b457a306a4442975210bcac3f04b56513c61c3.tar.gz
pardes-a8b457a306a4442975210bcac3f04b56513c61c3.zip
Merge: Def/Refs, the diff viewer, Helix n/N, Callstack, Zig 0.17, Window mode and the terminal cwd fix onto 0.24
The docs keep both sides: 0.24's Ctrl-i fallbacks and typed ls with this line's Window mode, raw Esc and Helix n/N wording. The CHANGELOG's unreleased entries go above 0.24, Def/Refs and the context rows among them. cheatsheet-a4.pdf rendered again; .scratch/ ignored. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/fs.zig')
-rw-r--r--src/fs.zig8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/fs.zig b/src/fs.zig
index fb76cee3..061d4225 100644
--- a/src/fs.zig
+++ b/src/fs.zig
@@ -677,7 +677,7 @@ pub fn statPath(io: std.Io, path: []const u8, options: std.Io.Dir.StatFileOption
}
test "a path with a part over 255 bytes is NameTooLong, never a panic" {
- const long = "/tmp/" ++ "x" ** 300 ++ "/f";
+ const long = "/tmp/" ++ &@as([300]u8, @splat('x')) ++ "/f";
try std.testing.expectError(error.NameTooLong, statPath(std.testing.io, long, .{}));
}
@@ -1152,7 +1152,7 @@ pub fn find(arena: std.mem.Allocator, dir: []const u8, pat: []const u8, out: []u
notes.skipped += 1;
continue;
}) orelse break;
- if (std.ascii.indexOfIgnoreCase(e.basename, pat) != null) {
+ if (std.ascii.findIgnoreCase(e.basename, pat) != null) {
hits[hits_len] = try arena.dupe(u8, e.path);
hits_len += 1;
}
@@ -1167,7 +1167,7 @@ pub fn find(arena: std.mem.Allocator, dir: []const u8, pat: []const u8, out: []u
} else {
for (sources) |s| {
if (hits_len >= hits.len) break;
- if (std.ascii.indexOfIgnoreCase(std.fs.path.basename(s.path), pat) != null) {
+ if (std.ascii.findIgnoreCase(std.fs.path.basename(s.path), pat) != null) {
hits[hits_len] = s.path;
hits_len += 1;
}
@@ -1201,7 +1201,7 @@ fn grepText(path: []const u8, text: []const u8, pat: []const u8, out: []u8, budg
while (it.next()) |raw| {
line += 1;
if (result.hits >= budget) break;
- const at = std.ascii.indexOfIgnoreCase(raw, pat) orelse continue;
+ const at = std.ascii.findIgnoreCase(raw, pat) orelse continue;
const ln = std.mem.trimEnd(u8, raw, " \t\r");
var cut = @min(ln.len, 200);
while (cut > 0 and cut < ln.len and ln[cut] & 0xc0 == 0x80) cut -= 1;