svermeulen / vim-subversive

Vim plugin providing operator motions to quickly replace text
MIT License
298 stars 4 forks source link

Range functions without confirm don't work #25

Closed demiaus closed 2 years ago

demiaus commented 2 years ago

Using Vim 9.0 these functions don't seem to work:

while these work:

If I do SubversiveWordRange in Visual mode, it fails silently and all the subsequent errors are also silent.

With bare minimum testrc the error is:

Error detected while processing function subversive#lineRangeMotion#selectRangeMotion[50]..<SNR>35_execRepeatableCommand:
line    2:
E16: Invalid range

My minimum testrc is:

set nocompatible
filetype on
filetype plugin on
filetype indent on
syntax on

call plug#begin()
Plug 'svermeulen/vim-subversive'
call plug#end()

let mapleader = " "

nmap s           <Plug>(SubversiveSubstitute)
nmap ss          <Plug>(SubversiveSubstituteLine)
nmap S           <Plug>(SubversiveSubstituteToEndOfLine)
nmap <Leader>s   <Plug>(SubversiveSubvertRange)
nmap <Leader>ss  <Plug>(SubversiveSubvertWordRange)
nmap <Leader>cs  <Plug>(SubversiveSubstituteRangeConfirm)
nmap <Leader>css <Plug>(SubversiveSubstituteWordRangeConfirm)
xmap <Leader>s   <Plug>(SubversiveSubvertRange)
xmap s           <Plug>(SubversiveSubstitute)
xmap p           <Plug>(SubversiveSubstitute)
xmap P           <Plug>(SubversiveSubstitute)
xmap <Leader>cs  <Plug>(SubversiveSubstituteRangeConfirm)

If I include Plugin vim-polyglot then the error is different:

Error detected while processing function subversive#lineRangeMotion#selectRangeMotion[50]..<SNR>64_execRepeatableCommand:
line    2:
E464: Ambiguous use of user-defined command: '[,']S/Plug/foo/wg
svermeulen commented 2 years ago

I haven't dug deeply into this but just wanted to mention that the Subvert commands require vim-abolish as mentioned here so could be related to this problem

demiaus commented 2 years ago

Yeah, sorry, that was it. I swear I read the readme and could have sworn I never had vim-abolish before when everything was working, but that's my faulty memory and attention span speaking.