editor: one editor, and everything written saves itself

TextEditor.svelte is folded into Editor.svelte. A card's description and a
note in the scratchpad are written in the same editor as a document, with
the same `[[` completion, and kept the same way: a new Writing (writing.svelte.ts)
stashes each change in localStorage and sends it to the server once the
typing stops, retrying a server that cannot be reached and recovering a
draft a dead tab left behind.

The keys out are the same everywhere: `:w` saves sooner, `:q` or Esc in
normal mode leaves with what is waiting written first, and stays where that
fails; `:q!` lets go of what is not saved. The store's describing and
scratch-editing flags are getters over the one `writing`.
This commit is contained in:
nvrl committed 2026-10-22 10:57:56 +02:00
1 parent b8b3641e6e
commit ccc91028e7
13 files changed
+426 -360

No files matched your search

+2 -2
View File
@@ -64,8 +64,8 @@ its tiles, so switching away and back finds them as they were. More in
### Writing
`i` edits the open document. The editor is CodeMirror with real vim keys:
`ciw`, `dd`, visual mode, macros, `.` and the rest. `Esc` leaves insert mode,
and `:q` leaves the editor.
`ciw`, `dd`, visual mode, macros, `.` and the rest. What you write saves itself.
`Esc` leaves insert mode, and `Esc` again or `:q` leaves the editor.
![The editor](../images/editor.png)