summaryrefslogtreecommitdiff
path: root/test/snapshots/filewatch.snap
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-29 04:18:04 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:15 -0300
commit35e72930c11af5563da9d62df2b74a7439f36653 (patch)
treebe71dac5f6eea6629c0a40377a6b6fb2ad14c767 /test/snapshots/filewatch.snap
parent4b64d4b237b2bc5f8197e2232c84c0d1ed1a8fdb (diff)
downloadpardes-35e72930c11af5563da9d62df2b74a7439f36653.tar.gz
pardes-35e72930c11af5563da9d62df2b74a7439f36653.zip
A file changed on disk never reloads over unsaved edits
A watched file rewritten on disk was loaded over a buffer's unsaved edits and its dirty flag cleared, so Exit and Del no longer asked about them. A clean buffer still reloads; one with edits keeps its text and stays dirty, says <file> changed on disk (get reloads it, Save overwrites it), logs changed <serial>, and its Save warns once before overwriting the newer file, as acme's Put refuses a file modified since read (exec.c:577); get asks as ever (winclean, exec.c:513). The restored-watch test's dirty case now keeps the snapshot, and the filewatch snapshot script (re-recorded by name) checks both halves: the edited pane keeps its edit and says so, the clean one reloads. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'test/snapshots/filewatch.snap')
-rw-r--r--test/snapshots/filewatch.snap19
1 files changed, 7 insertions, 12 deletions
diff --git a/test/snapshots/filewatch.snap b/test/snapshots/filewatch.snap
index 9e6e6a13..6664519f 100644
--- a/test/snapshots/filewatch.snap
+++ b/test/snapshots/filewatch.snap
@@ -1,6 +1,6 @@
-# external file updates: a write from outside pardes lands in the open pane,
-# and Undo brings the unsaved edit back. That is the whole contract — the
-# update is committed like any other edit, so nothing has to be merged.
+# external file updates: a write from outside pardes lands in an open pane
+# that has no unsaved edits, committed like any other edit; a pane WITH
+# unsaved edits keeps them and says the file changed on disk (File.changed).
#
# The writer must be a STRANGER to the editor. This script used to have a
# pardes PANE run the write, which proved much less than it looked: that
@@ -54,18 +54,13 @@ settle 100
stable 400 5000
snap edited
# ---- from here to `snap reloaded_sub`, pardes is sent NOTHING ----
+# w.txt has the unsaved edit: it is kept, and the change is said
run printf 'EXTERNAL\n' > w.txt
-wait 10000 EXTERNAL
+wait 10000 changed on disk
stable 700 10000
-snap reloaded
+snap kept
+# sub/s.txt has none: it takes the new text
run printf 'RENAMED\n' > sub/t && mv sub/t sub/s.txt
wait 10000 RENAMED
stable 700 10000
snap reloaded_sub
-# back in the file pane: one undo and the unsaved edit is there again
-press left 10 8
-release left 10 8
-stable 400 5000
-key u
-stable 400 5000
-snap undone