Repository navigation
Description
- Type: Enhancement
- Priority: Low
Problem
ZenNotes does not currently preserve undo history when switching between tabs. After switching away from a note and returning to it, previously made changes can no longer be undone.
Vim provides the undofile option, which allows undo history to be persisted so that it can be restored later.
Proposed Enhancement
Add support for an undofile setting that allows ZenNotes to persist undo history when a note is closed and later reopened, including when switching tabs or windows.
When enabled:
- Undo history is preserved when leaving a note.
- Undo history is restored when returning to the note.
- Previously available undo actions remain accessible after switching tabs, windows, or reopening the note.
Example
- Open a note.
- Make several changes.
- Save and close the note.
- Reopen the note.
- Press
uto undo the previous changes.
Considerations
- The setting should be configurable so users can choose whether undo history is persisted.
- Undo history should remain associated with the correct note.
- Undo history should be stored independently of the note's normal content.
- The implementation should avoid unnecessary storage or performance overhead.
Rationale
Preserving undo history would make tab switching feel more consistent with Vim and prevent users from losing access to previous undo actions simply because they switched away from or closed a note.
Current Workaround
Avoid switching away from a note until all required undo actions have been completed, or manually delete the unwanted change after switching back to the tab.
Additional Context
Vim's undofile option provides persistent undo history across editing sessions.
ZenNotes could provide a similar experience while adapting the behaviour to its tab-based workflow.
Activity
Fix(editor): each note keeps its own undo history across tab switches (…
adibhanna commentedon Sep 17, 2026
Fixed on the
v2.52.0branch, ships in 2.52.0: 27c09c98.What was going on. Each pane has one editor, and switching tabs swaps the note inside it. Since 2.7.0 that swap empties the undo history on purpose, because a history that crossed it let
Cmd/Ctrl+Zpaste the previous note over the current one (#247). The side effect is what you reported: leave a note for a second and every undo step on it was gone.What you get now. Each note keeps its own undo history while the app is open:
u/Ctrl+ZandCtrl+r/ redo walk through your edits as if you never left.u.Found while testing this, fixed in the same release (5b39bc8c): renaming the note you are editing (or moving it, or renaming its folder) threw the caret to the top and wiped its undo history. It now keeps the caret, the scroll position and the history. And when a note changes underneath the editor (another pane, a file change on disk), your undo history on it survives, where it used to be silently emptied.
Where it differs from the proposal, so you are not surprised:
undofileproper: undo data written to disk, which needs a decision about where it lives (it contains fragments of deleted text, and it should not sync with the vault or land in a git-backed vault). I did not want to hold the everyday fix back for that. If undo surviving a full quit and relaunch matters to you in practice, say so here and it gets its own issue.How to check once 2.52.0 is out: open a note, make a couple of edits, switch to another tab and back, press
u. Then close the note, reopen it from the sidebar, and pressuagain.Thanks for another precise write-up.
Feat(editor): undo history can survive quitting, Vim's undofile (#793)
adibhanna commentedon Sep 17, 2026
Follow-up on point 2 above: undo history can now survive quitting the app, so the "not across a restart" caveat no longer holds. bd0dc111, also in 2.52.0.
It is the setting you asked for, and it is Vim's name for it too:
:set undofile(:set noundofileto turn it off,:set undofile?to check), or the command palette. Inconfig.tomlit ispersist_undo_historyunder[editor].u/Ctrl+ZandCtrl+r/ redo still step through them.Things worth knowing:
undodir), so it does not sync to other machines and never ends up in a git-backed vault.Fix(editor): undo after the open note changed on disk no longer saves…