RyotaUshio / obsidian-inline-math

No longer disturbed by flickering inline math in Obsidian.
MIT License
21 stars 0 forks source link

Vim commands such as `y`, `r` and `~` result in invalid cursor positions #10

Open RyotaUshio opened 1 week ago

RyotaUshio commented 1 week ago

See https://github.com/RyotaUshio/obsidian-inline-math/pull/9#issuecomment-2468140997

carpetdev commented 1 week ago

Interestingly, repeatedly alternating the keypresses ~ followed by <C-z> has the following effect: The first time the cursor jumps back two positions, and all subsequent times it jumps back three positions. (Note that <C-z> is obsidian/codemirror's native undo. Vim's undo key of u actually jumps to the start of the expression with this plugin - presumably because it detects the brace insertion being the most recent change)

I wonder if a cheap fix for all of this would be to have a plugin option of just persisting the braces beside the dollars from the moment the dollar is inserted instead of automatically removing them every time the expression is deselected and then reinserting them when needed.