summaryrefslogtreecommitdiff
path: root/src/pardes.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/pardes.zig')
-rw-r--r--src/pardes.zig13
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);