esm7/obsidian-vimrc-support

editor obcommands don't modify selections

jbytes1027 opened this issue · 2 comments

editor obcommands don't respect selections like their respective obsidian keybindings do. For instance, Ctrl+b by default toggles bold formatting of the current selection in visual mode, but obcommand editor:toggle-bold in visual mode with a selection simply inserts **** wherever the cursor was in normal mode. This makes these commands pretty useless. The problem with the surround commands is that you can't toggle on and off a surround.

I have the same issue. I have a Templater command with tp.file.selection(), and it doesn't work either.

Got this working here. Though I changed obcommand from an editor command to an action commands.