diff options
Diffstat (limited to 'core/File.zig')
| -rw-r--r-- | core/File.zig | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/core/File.zig b/core/File.zig index 2affde32..18745930 100644 --- a/core/File.zig +++ b/core/File.zig @@ -2441,8 +2441,9 @@ pub fn changed(p: *Pardes, id: u8, bytes: []const u8) void { if (f.disk_newer == disk) return; f.disk_newer = disk; f.disk_newer_warned = false; - var said: pardes.Kind.Buf(limits.host_path_cap + 64) = .{}; - p.setMessage(.at(id), said.print("{s} changed on disk (get reloads it, Save overwrites it)", .{f.path[0..@min(f.path.len, limits.host_path_cap)]})); + // A question in its tag, never the keyboard's (pick-ui SPEC ยง10.2): + // one waiting already is the one about it. + if (p.messages.waiting(pane) == null) pardes.Messages.say(p, .question, id, "changed on disk").asks = .disk; var rec: [16]u8 = undefined; pardes.ctlfs.events.notePath(p, "changed", std.fmt.bufPrint(&rec, "{d}", .{pane.serial}) catch unreachable); // a u32 fits 16 return; @@ -3526,7 +3527,7 @@ test "a text replaced whole keeps its old buffer for its undo, swapped back and setContent(p, f, try gpa.dupe(u8, t)); } try std.testing.expectEqual(@as(usize, 2), j.done); - try std.testing.expect(std.mem.indexOf(u8, pane.msg[0..pane.msg_len], "undo keeps the last two texts replaced whole") != null); + try std.testing.expect(std.mem.indexOf(u8, p.messages.saidBy(pane), "undo keeps the last two texts replaced whole") != null); try undoStep(p, pane, true); try undoStep(p, pane, true); try std.testing.expectEqualStrings(texts[1], f.content); |
