Closed mriva closed 1 month ago
Well, you were really unlucky with your timing. That's a bug I accidentally introduced an hour ago, and which I fixed a few minutes after you submitted this bug report 🙈
update to the latest version and this should be fixed
Updated to f39e8c82250549431979d2d18eae3e6b97b46f04 but the issue remains.
are you sure? using f39e8c8, I cannot reproduce the issue with the minimal config.
ah, the issue is that you are using :lua require("rip-substitute").sub()
in the RHS of your mapping. The :
causes nvim to leave visual mode, which is why rip-substitute is then not able to pick up the correct mode anymore.
Use function() require("rip-substitute").sub() end
as RHS of your keymap, and everything works correctly (And that is why we should actually use the minimal configs provided ;) )
Ah I see. Well I actually used the minimal config, but I was manually calling require("rip-substitute").sub()
since I missed the binding provided and fell back to documentation (it was the only interface the README provided so I went with that).
I see you just added :RipSubstitute
to the doc which also works.
Maybe function() require("rip-substitute").sub() end
should be added to the README as well since the need for a wrapper function is not really clear.
Thanks for your help!
Ah, yes, it's fully written out in the Installation section, but not the Usage section. Added, thanks.
Make sure you have done the following
Bug Description
When starting a sub with in visual line mode, the substitution defaults to normal mode instead of restricting to the range.
Relevant Screenshot
https://github.com/chrisgrieser/nvim-rip-substitute/assets/899235/6abcf94f-da69-4e66-af9b-07f0fdda7d0c
Screen recording taken with my setup, same behaviour happens with the minimal conf you provide in the last box of this form
To Reproduce
vnoremap <leader>s :lua require("rip-substitute").sub()<cr>
neovim version
ripgrep version
Minimal reproducible config