Surround [[ not working in visual mode
Please Review Before Posting!
- [x] I'm reasonably sure that this bug is indeed about the Vimrc file support and not a general Vim in Obsidian issue. If it's a general Vim issue, report it here.
Describe the bug: Firstly many thanks for this plugin!
Have added the surround_wiki [[ command to the vimrc file and this is working in normal mode (I have updated to include the <CR> tag in my file). However, this is not working in visual mode, meaning that I can only use the [[ shortcut to surround_wiki a single word, rather than selecting multiple words as the title of a note to wiki link.
In the command line, it is returning an error: RangeError: Invalid change range x to y (in doc of length z) Which means (I think) it is trying to jump to a line in the file that does not exist.
To Reproduce: vimrc file: exmap surround_wiki surround [[ ]] map [[ :surround_wiki<CR>
Enter visual mode and select multiple words, press [[ to surround_wiki these words. Returns the above error.
Environment (please complete the following information):
- OS: Windows
- Vimrc plugin version: 0.10.1
I'm also facing it. It actually stopped working (for me) with a selection from right to left. I've prepared a simple demo.
https://github.com/user-attachments/assets/4d0ac970-3cab-414c-ad51-a9c86611a239
-
OS: MacOS 14.4.1
-
Obsidian: 1.7.4
-
Vimrc plugin version: 0.10.1
-
I updated the Obsidian & Vmirc Plugin yesterday. Before the update - the surrounding functionality worked correctly, I used to use it every day.
- Previous versions: (don't remember minor versions)
- Vimrc Plugin: 0.9.*
- Obsidian: 1.6.*
- Previous versions: (don't remember minor versions)
Yeah I always make sure to use it when text is selected left-to-right, I figured this was always a small bug in the implementation
(protip - hit o while in visual mode to switch selection direction)
Oh, looks like this is a duplicate of #234 which has been fixed already, the fix just hasn't been released yet? @esm7
Indeed, I haven't released a version for a while, aiming for this week.
Thanks for the release @esm7 🙏
I've upgraded and can confirm that in 0.10.2 the issue from my demo has disappeared (fixed).
Thanks! 🚀
Same here—thanks @esm7 !