nothingislost / obsidian-codemirror-options

Obsidian plugin with options to customize the behavior of CodeMirror
GNU General Public License v3.0
172 stars 13 forks source link

New html is not rendered unless I switch to a different note and back. #96

Open kyrisu opened 2 years ago

kyrisu commented 2 years ago

First, I would like to say a big THANK YOU! for this amazing plugin.

I'm experiencing a weird issue where when I select text and highlight it (basically wrapping it in a <mark>), then leaving the edited text by adding a new line for example - the HTML is not being rendered. Only when I change to a different note and then go back - the highlight is rendered.

This is how it looks:

https://user-images.githubusercontent.com/212681/143436097-c278d3b5-326d-47c4-aa73-58609b1855e5.mov

I'm using VIM mode if that makes the difference.

nothingislost commented 2 years ago

Wow, that's really surprising. It definitely has something to do with VIM as this does not occur with VIM mode disabled. It seems to be related to how text is inserted when you're in VIM command mode. If you're in VIM insert mode, this also doesn't happen.

For now you can work around this by highlighting while in insert mode. I know, a cardinal VIM offense but still :) I'll see if there's some event I'm missing when inserting text from command mode.

kyrisu commented 2 years ago

Thanks for looking into it!

Yes, that's a valid workaround (I'm not highlighting so often for it to bother me to use a mouse)