Undo loses selection position

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.


  • 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.

This is strange, not sure why this would happen. Are you using vim keybindings?

Did you try turning of all community plugins and themes / or creating a new empty vault to test?

I don’t use vim keybindings.

I tried this both in my main vault with a bunch of plugins and in the Help vault with no community plugins/themes in it.

1 Like

This is strange, I don’t know what may be causing it, hopefully some else can take a look at it. Good luck with it

this should be fixed now

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.