diff options
| author | Gabriel Schneider <[email protected]> | 2026-10-01 19:11:53 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 19:57:27 -0300 |
| commit | 5f41a03fdcf0eaa3c1917e0f94243878c481cf8b (patch) | |
| tree | c3025e2ca80a295962fa941bb4423df9a1525509 /src/pardes.zig | |
| parent | 6ee4c3caa6faf42b9825dca39e9130ac83f425a8 (diff) | |
| download | pardes-5f41a03fdcf0eaa3c1917e0f94243878c481cf8b.tar.gz pardes-5f41a03fdcf0eaa3c1917e0f94243878c481cf8b.zip | |
Incl dir ... adds directories a look at a name found nowhere else is tried in, as acme's includename, <stdio.h> too; bare Incl lists them and Incl - empties them; the session's, seeded with /usr/include and /usr/local/include, kept in a dump; Indent's refusal says Enter keeps the indent always
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/pardes.zig')
| -rw-r--r-- | src/pardes.zig | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/pardes.zig b/src/pardes.zig index 425a0993..36a37293 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -4324,6 +4324,10 @@ pub const Pardes = struct { /// The files opened lately, closed ones too (recent.zig): `Recent`, /// /recent, and the jumplist's way back to a closed pane. recent: recent_files.List = .{}, + /// acme's Incl: the directories a look at a name that is nowhere else + /// (`stdio.h`, `<foo.h>`) is tried in, in order. The session's, seeded + /// with C's (/usr/include, /usr/local/include), kept in a dump. + incl: std.ArrayList([]u8) = .empty, /// The kept list was read (or there was none): only then is it written, /// so a session never writes over one it did not read. recent_loaded: bool = false, @@ -4709,6 +4713,13 @@ pub const Pardes = struct { } p.sync(); p.loadRecent(); + for (config.default_incl) |dir| { + const copy = try gpa.dupe(u8, dir); + p.incl.append(gpa, copy) catch |err| { + gpa.free(copy); + return err; + }; + } exec.applyStartupConfig(p); colors.finishThemeInitialization(p); p.sync(); @@ -4816,6 +4827,8 @@ pub const Pardes = struct { for (p.panes) |slot| if (slot) |pane| p.noteClosed(pane); p.saveRecent(); p.recent.deinit(p.recentGpa()); + for (p.incl.items) |dir| p.gpa.free(dir); + p.incl.deinit(p.gpa); p.fs.batch.bytes.deinit(p.gpa); if (p.stand_in) |pane| p.teardownPane(pane); look.cancelLookHover(p); |
