Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] g:surround_{char2nr('\')} will conflict with built-in cst #365

Open
Freed-Wu opened this issue Sep 27, 2022 · 2 comments
Open

[bug] g:surround_{char2nr('\')} will conflict with built-in cst #365

Freed-Wu opened this issue Sep 27, 2022 · 2 comments

Comments

@Freed-Wu
Copy link

#!/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<

Screenshot from 2022-09-27 22-11-56

Expected behaviour

Type fYcst<p>

Screenshot from 2022-09-27 22-12-17

@jiz4oh
Copy link

jiz4oh commented Apr 20, 2023

I can complete this by let g:surround_{char2nr('<')} = "<\1<: \1>\r</\1\1>"

@Freed-Wu
Copy link
Author

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<.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants