Skip to content

Watch open files for external changes and reload safely - #1014

Open
Preston (riyueniao) wants to merge 1 commit into
microsoft:mainfrom
riyueniao:feat/219-watch-files-reload
Open

Preston (riyueniao) wants to merge 1 commit into
microsoft:mainfrom
riyueniao:feat/219-watch-files-reload

Conversation

@riyueniao

Copy link
Copy Markdown

Fixes #219

Summary

  • Poll open files for external changes while the terminal is focused; check immediately when it regains focus (VT and Windows console focus events). No new dependencies.
  • Reload clean documents after a stable change, preserving the cursor and existing buffer on read failure.
  • For dirty documents, show a wrapping Warning with Keep Changes / Reopen actions; guard saving against accidentally overwriting external edits.
  • Add regression tests for focus scheduling, conflict handling, reload failures, missing/created files, and warning wrapping.

Validation

  • cargo test -p edit (107 passed, 1 ignored)
  • cargo clippy -p edit --bin edit -- -D warnings
  • git diff --check

@riyueniao

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

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.

Watch files for changes and reload them

1 participant