Discard missing files from saved sessions

Sanitize nonexistent unmodified file buffers and stale argument-list entries after session load and before automatic save.
This commit is contained in:
Ray Elliott 2026-10-28 19:38:17 +00:00
commit aedc1d7b86
3 changed files with 62 additions and 6 deletions

View file

@ -20,6 +20,7 @@ Session support is automatic but user-controlled:
- On startup: auto-loads `Session.vim` if it exists (unless files specified on command line)
- On exit: auto-saves to `Session.vim` if it already exists
- Netrw and its preview windows are omitted from the saved layout; generated `NetrwTreeListing` buffers are not restorable
- Missing files are removed from restored buffers and argument lists, so deleted files cannot become persistent empty session buffers
- Sessions are per-directory and opt-in (just create one to start using)
**Stop using a session**: