dailz 967c11fea9 fix(tui): preserve old state on load_file failure (issue #32)
load_file previously cleared file_watcher before attempting to open the
new file. If open failed, the watcher was lost while loading_state and
file_path still pointed to the old file, breaking change detection.

Refactor to build-then-swap pattern: all fallible work runs on local
variables first, then self is updated only on success. On failure, the
old file's watcher, loading_state and file_path remain intact.

Update test to verify all three fields are preserved on failure.

Closes #32
2026-06-11 17:23:16 +08:00
S
Description
No description provided
1 MiB
Languages
Rust 100%