summaryrefslogtreecommitdiff
path: root/src/tty
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/tty
parent1891a51ed2b64eec3964d3af3807be90d08a14c2 (diff)
downloadpardes-79a8980e46d8ed1f9ef7e3f4e44db7ee58e9f88e.tar.gz
pardes-79a8980e46d8ed1f9ef7e3f4e44db7ee58e9f88e.zip
add the transient message row
Diffstat (limited to 'src/tty')
-rw-r--r--src/tty/tty.zig12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/tty/tty.zig b/src/tty/tty.zig
index 6047e5a2..b5b4ff75 100644
--- a/src/tty/tty.zig
+++ b/src/tty/tty.zig
@@ -12,6 +12,7 @@ const pardes = @import("../pardes.zig");
const tracy = @import("../tracy.zig");
const look = @import("../look.zig");
const temp_file = @import("../temp_file.zig");
+const message = @import("../message.zig");
const selection_pipe = @import("../selection_pipe.zig");
extern "c" fn forkpty(amaster: *c_int, name: ?[*:0]u8, termp: ?*const anyopaque, winp: ?*const posix.winsize) c_int;
@@ -648,6 +649,12 @@ pub fn run(init: std.process.Init, opts: pardes.Options) !void {
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 above), 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));
}
}
@@ -882,6 +889,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;