esm7 / obsidian-vimrc-support

A plugin for the Obsidian.md note-taking software
MIT License
1.07k stars 47 forks source link

editor obcommands don't modify selections #187

Open jbytes1027 opened 1 year ago

jbytes1027 commented 1 year ago

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.

MiracleXYZ commented 7 months ago

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

jbytes1027 commented 7 months ago

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