From 79a8980e46d8ed1f9ef7e3f4e44db7ee58e9f88e Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 5 Aug 2026 16:28:03 -0300 Subject: add the transient message row --- src/gui/gui.zig | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/gui/gui.zig') 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; -- cgit v1.3