User guide / Files and buffers

Files changed outside Runyte

Development reference · View source

Runyte watches the parent directory of every open file and the directory of every open explorer, in both modes, even while a persistent TUI is detached.

When a path no longer agrees with the state accepted at open, save, reload, or refresh:

  • Every pane showing it, and the status line, show [STALE]. The buffer list marks hidden stale buffers too.
  • [STALE] is separate from [+], so an edit that conflicts with disk reads [+] [STALE].
  • Text, selections, undo, and language-server state are kept.
  • The first observation of each disk revision creates one WARNING notification.

When a stale file or explorer is attached to no pane, bringing it back into a pane automatically refreshes it from disk if it has no unsaved edits. A buffer shown in any pane keeps the behavior above, including when another pane is maximized. A terminal covering a buffer puts that buffer in the background. Deleted, unreadable, or binary replacements leave the retained contents and stale marker intact.

What you can do:

CommandEffect
Space b d or :diff-diskOpen the disk version as [disk] path [RO] beside your buffer, in a live side-by-side comparison
Space r or :reloadReload. A clean buffer reloads at once; a dirty one asks first
:write!Save over the changed file
  • :diff-disk reads the path again. The disk version is on the left and your editable buffer on the right; the comparison follows later edits. Deleted, unreadable, and binary versions, and versions over the comparison size limit, are refused without changing panes.
  • :reload on a dirty buffer names the path and the undo history that will be discarded. Escape or Ctrl-c keeps the buffer. Enter applies only the exact disk revision reviewed; if the file changes again, the buffer is kept and the new revision must be reviewed.
  • :write! is the explicit way to replace a changed file. An ordinary save refuses a known conflicting revision before save hooks can edit the buffer. [STALE] clears only after the written file is verified.

Resolving by itself:

  • When your text and the disk text become equal, Runyte adopts the disk version and marks the buffer clean, keeping usable undo history.
  • A deleted file stays stale, but an ordinary save may recreate it.
  • Binary and unreadable replacements are never loaded into a text buffer.