A2: Compare with Disk as a UI command (editor.compareWithDisk)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
danny 2026-11-08 12:26:51 +01:00
parent d2344bf216
commit 59313f3f62
6 changed files with 47 additions and 4 deletions

View file

@ -23,7 +23,7 @@ Lutra watches the folders of every open file (`docs/architecture.md` › VFS). E
- **Reload (discard mine)** replaces your text with the file's (`file.reload`). Your text goes into the Local History first.
- **Keep mine** hides the banner. The next save asks once more before it overwrites the newer file.
- **Compare** opens a diff tab: the file on disk on the left, your text on the right (`file.readDisk`). You can edit the right side; it is the same buffer as the tab.
- **Compare** opens a diff tab: the file on disk on the left, your text on the right (`file.readDisk`). You can edit the right side; it is the same buffer as the tab. The palette's Compare with Disk does the same for any file.
- **Close** closes the tab without saving; the text is in the Local History.
### Saving never overwrites a newer file silently
@ -80,6 +80,7 @@ Files that are not open in Lutra are not watched for the history. git protects t
| `history.read {path, id}` | One entry's text, answered like `git.show`. |
| `history.revert {path, id}` | Puts an entry's text into the buffer (an undoable `buffer.edit`). |
| `history.show {path?}` | UI command: the dialog. |
| `editor.compareWithDisk {path?}` | UI command: the banner's Compare for any file (palette, agents). |
Events: `fileChangedOnDisk {path, id, removed}` sets the banner, `diskConflictResolved {id}` removes it.