Skip to content

fix(editor): resolve recovered external-file warnings - #336

Merged
fcoury merged 1 commit into
mainfrom
fcoury/external-file-notification-recovery
Aug 24, 2026
Merged

fcoury merged 1 commit into
mainfrom
fcoury/external-file-notification-recovery

Conversation

@fcoury-oai

Copy link
Copy Markdown
Collaborator

External-file warnings currently require explicit acknowledgment even after the underlying conflict disappears. This leaves a misleading deletion warning active when tools such as Git briefly remove and recreate an open file during a rebase or checkout.

This change tracks external-file warnings per buffer and resolves the active warning when the buffer and disk converge again. Recovery through the file watcher, reload, save or save-as, :diffdisk, and buffer close all clear the corresponding warning while retaining it in message history.

A regression test covers deleting an open clean file and recreating it with unchanged contents, including the conflict marker and notification attention counts.

How to Test

  1. Open a tracked file in Red, delete it externally, and wait for the file watcher. Confirm Red shows the [DELETED] marker and an external-file warning that needs attention.
  2. Recreate the file with its original contents. Confirm the marker and active warning disappear without manual acknowledgment, while the resolved event remains available in :messages.
  3. Run cargo test editor::file_watch::tests; all file-watch tests should pass, including recreating_an_unchanged_file_resolves_its_deletion_notification.

@fcoury
fcoury merged commit bec67fb into main Aug 24, 2026
10 checks passed
@fcoury
fcoury deleted the fcoury/external-file-notification-recovery branch August 24, 2026 01:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants