You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@fxha Regarding the keyboard input, from my understanding, you are using something quite different, but wouldn't it be easiest to just listen for keydown events and use event.key for text input event.code for keyboard shortcuts
document.onkeydown=(ev)=>{console.log(ev);}// Example: Pressing on the physical K key on a Colemak keyboard results in// KeyboardEvent {isTrusted: true, key: "e", code: "KeyK",.... }// which is perfect, because K is mapped to an E on the Colemak keyboard
@stefnotch I guess this is not a shortcut problem instead a limit due memory usage that @Jocs implemented. All shorcuts should be mapped correctly because they are read from the system in the main process where we have no access to document. The undo/redo history is limited until we refactor our core and data structure. This may happen if you press multiple times Ctlr+Z and Ctrl+Shift+Z may not work after it or is limited to 1 or 2 redos.
I can also reproduce in both 0.15 and 0.16. there is definitely a malfunction.
Create a new paragraph
Write 2 separate words
Delete the first word (the second word remains)
Press Ctrl+Z. Instead of reverting the deleted first word, the entire paragraph was removed (maybe this was an undo way too far into the history?)
Pressing Ctrl+shift+Z now reverts the line but only to the state with a second word. There is no way to undo the delition of the first word. Toggling undo/redo only removes or reverts the line in the wrong state - the state after deletion of the first word instead of the state before deletion of the first word
Similar issues on macOS 10.14. Undo repeatedly does not behave in a sane manner (e.g. removes an entire paragraph instead of the one word I just typed), and I can't seem to get any redo functionality to work. Side note - love this editor, really excited to see it getting better over time!
i have a similar issue where when I press CTRL + Z It removes way too much text than expected. Instead of removing ~1 word, it removes the whole line, or a whole paragraph.
Reacted by Geoffrey Hichborn, Matthew Davidson, Gears and Rasmus Malver
I'm using the most current version of Mark Text and the fact that 1. undo doesn't work as expected (almost always deletes things that I didn't intend to delete) and 2. redo doesn't work at all (#2399), make this app unusable. Within the few hours I've been using it, I've lost multiple pieces of text because of this. Nothing important, but still frustrating.
Thank you for this report and to everyone who commented. This issue was caused by fundamental limitations in the old ContentState editor engine (acknowledged in the comments at the time). The editor engine has since been completely rewritten. The new engine uses an operation-transform (OT) based history system that computes lossless inverse operations for each edit, maintains a proper redo stack, and groups undo entries at word boundaries — so both undo granularity and redo are now correct. If you encounter any undo/redo problem in a recent build, please open a new issue with steps to reproduce against the current version.
Activity
stefnotch commentedon Sep 7, 2019
I also have this issue
stefnotch commentedon Sep 7, 2019
@fxha Regarding the keyboard input, from my understanding, you are using something quite different, but wouldn't it be easiest to just listen for
keydownevents and useevent.keyfor text inputevent.codefor keyboard shortcutsIr1d commentedon Sep 12, 2019
I can reproduce
fxha commentedon Sep 12, 2019
@stefnotch I guess this is not a shortcut problem instead a limit due memory usage that @Jocs implemented. All shorcuts should be mapped correctly because they are read from the system in the main process where we have no access to
document. The undo/redo history is limited until we refactor our core and data structure. This may happen if you press multiple timesCtlr+ZandCtrl+Shift+Zmay not work after it or is limited to 1 or 2 redos.nh2 commentedon Nov 14, 2019
Even a single undo/redo does not work correctly on 0.16-rc.
If you type
_a_and press undo (Ctrl+Z), it disapears, but if you then hit redo (Ctrl+Shift+Z), it does not reappear.hrvojegolcic commentedon Nov 14, 2019
I can also reproduce in both 0.15 and 0.16. there is definitely a malfunction.
Jocs commentedon Nov 17, 2019
@nh2 @hrvojegolcic Thanks for you feedback, we'll optimize
undo/redoin version 0.17.0.hamiltont commentedon Jan 22, 2020
Similar issues on macOS 10.14. Undo repeatedly does not behave in a sane manner (e.g. removes an entire paragraph instead of the one word I just typed), and I can't seem to get any redo functionality to work. Side note - love this editor, really excited to see it getting better over time!
snowc0de commentedon Aug 18, 2020
i have a similar issue where when I press CTRL + Z It removes way too much text than expected. Instead of removing ~1 word, it removes the whole line, or a whole paragraph.
KingMob commentedon Oct 1, 2020
Has this reappeared? I'm having the same problem.
stefandesu commentedon Dec 10, 2020
I'm using the most current version of Mark Text and the fact that 1. undo doesn't work as expected (almost always deletes things that I didn't intend to delete) and 2. redo doesn't work at all (#2399), make this app unusable. Within the few hours I've been using it, I've lost multiple pieces of text because of this. Nothing important, but still frustrating.
phene commentedon Dec 10, 2020
This is one of the bugs that lead to me and my colleague abandoning marktext in favor of Joplin.
fix: repair undo/redo malfunction (marktext#1321)
Jocs commentedon Jun 26, 2026
Thank you for this report and to everyone who commented. This issue was caused by fundamental limitations in the old ContentState editor engine (acknowledged in the comments at the time). The editor engine has since been completely rewritten. The new engine uses an operation-transform (OT) based history system that computes lossless inverse operations for each edit, maintains a proper redo stack, and groups undo entries at word boundaries — so both undo granularity and redo are now correct. If you encounter any undo/redo problem in a recent build, please open a new issue with steps to reproduce against the current version.