From 21d2240b9b86ae5ba0036988b0ed84fbcf18d3af Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 28 Sep 2026 12:24:04 -0300 Subject: Restore asks about unsaved text first, as Exit does Restore replaces every pane with a dump's, so a pane edited since its last save lost that text without a word, where Exit asks. acme's Load only adds a dump's windows and so never asks; Restore now asks what Exit asks (acme's rowclean and winclean, wind.c:511-529): each modified pane says so once, and Restore again with nothing edited since goes ahead. Exit and Restore share the check and its warned-at revision, as acme's winclean clears one dirty flag for any asker. Co-Authored-By: Claude Opus 5.5 --- test/fs.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test') diff --git a/test/fs.py b/test/fs.py index 2199a645..b90983d4 100644 --- a/test/fs.py +++ b/test/fs.py @@ -601,6 +601,13 @@ def test(binary, quic=False): assert old.read_fid(held_body) == b'dumped state\n' assert old.read_fid(held_screen, count=1) == b'{' old.write('/pane/1/body', b'changed after dump\n', truncate=True) + # Unsaved text is asked about once, as Exit asks; the second + # Restore goes ahead. + try: + execute(old, control, 'Restore ' + str(saved)) + except OSError as refused: + assert 'Modified' in str(refused), refused + assert old.read('/pane/1/body') == b'changed after dump\n' try: execute(old, control, 'Restore ' + str(saved)) except (EOFError, ConnectionResetError, BrokenPipeError): -- cgit v1.3