[bug] g:surround_{char2nr('\')} will conflict with built-in `cst`
Freed-Wu opened this issue · comments
wzy commented
#!/usr/bin/env -S vi test.vim + -u
" $ uname -r
" 5.19.7-arch1-1
" $ has
" ✓ vi 0.7.2
" $ cat test.vim
set runtimepath=$VIMRUNTIME
set runtimepath+=~/.local/share/nvim/repos/github.com/tpope/vim-surround
let g:surround_{char2nr('<')} = "< \r >"
" $ cat coc-settings.json
" $ chmod +x test.vim
" $ ./test.vim
" <div>Yo!*</div>
Actual behaviour
Type fYcst<
Expected behaviour
Type fYcst<p>
jiz4oh commented
I can complete this by let g:surround_{char2nr('<')} = "<\1<: \1>\r</\1\1>"
wzy commented
Because
cs}{
will change{test}
to{ test }
cs][
will change[test]
to[ test ]
cs)(
will change(test)
to( test )
So I hope:
cs><
will change<test>
to< test >
However it will conflict with cst<
.