Steps to reproduce
- Select any text in the editor
- Apply formatting that add some text (e.g. make text bold
**bold text**
) - Undo the change with Undo command (e.g. press ⌘-Z)
- Observe how selection shifted by the number of removed characters
Expected result
I’d expect the selection to match the initial selection.
Actual result
Selection drifts.
Environment
- Operating system: macOS 11.2
- Obsidian version: v0.11.7
Additional information
This can be reproduced with all source-changing commands I tried (e.g. bold, italic, highlight).
This can not be reproduced when surrounding test is typed: e.g. select a word and type *
(or a brace, backtick, etc.), undo will correctly maintain the selection.