summaryrefslogtreecommitdiff
path: root/src/gui/gui.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-08-05 16:28:03 -0300
committerGabriel Schneider <[email protected]>2026-08-10 09:17:07 -0300
commit79a8980e46d8ed1f9ef7e3f4e44db7ee58e9f88e (patch)
tree65ebb32c55b4b91efc6f23c2142a0971a602611c /src/gui/gui.zig
parent1891a51ed2b64eec3964d3af3807be90d08a14c2 (diff)
downloadpardes-79a8980e46d8ed1f9ef7e3f4e44db7ee58e9f88e.tar.gz
pardes-79a8980e46d8ed1f9ef7e3f4e44db7ee58e9f88e.zip
add the transient message row
Diffstat (limited to 'src/gui/gui.zig')
-rw-r--r--src/gui/gui.zig12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gui/gui.zig b/src/gui/gui.zig
index b496058e..a4883fa6 100644
--- a/src/gui/gui.zig
+++ b/src/gui/gui.zig
@@ -20,6 +20,7 @@ const ghostty_vt = @import("ghostty-vt"); // 256-color palette for .index cells
const pardes = @import("../pardes.zig");
const config = @import("../config.zig");
const look = @import("../look.zig");
+const message = @import("../message.zig");
const deck = @import("deck.zig");
const crt = @import("crt.zig");
const fonts = @import("fonts.zig"); // the Font builtin's half of the seam
@@ -816,6 +817,12 @@ fn reloadChanged(core: *pardes.Pardes, gpa: std.mem.Allocator, watches: *[pardes
if (h == slot.*.?.hash) continue;
slot.*.?.hash = h;
core.update(.{ .file_changed = .{ .pane = @intCast(id), .bytes = bytes } });
+ // the hash moving IS "someone else wrote this file" (our own Save
+ // restamped it), so the pane says who did what to it — and it says it
+ // after the update, which cannot clear a message because only a key or
+ // a mouse event does
+ var mbuf: [256]u8 = undefined;
+ core.setMessage(id, message.stamp(&mbuf, "reloaded", f.path));
}
}
@@ -2623,6 +2630,11 @@ fn drainEffects(
// our own write is about to come back as a watch event: restamp
// from the bytes we just put there so it reads as "no change"
if (watches[sf.pane]) |*w| w.hash = std.hash.Wyhash.hash(0, f.content);
+ // ...and say so on the pane's message row. AFTER the write, not
+ // beside it: every `continue` above is a save that did not happen
+ // and must not be reported as one.
+ var mbuf: [256]u8 = undefined;
+ core.setMessage(sf.pane, message.stamp(&mbuf, "saved", f.path));
},
.new_file => |request| {
var path_buf: [4096:0]u8 = undefined;