kylechui / nvim-surround

Add/change/delete surrounding delimiter pairs with ease. Written with :heart: in Lua.
MIT License
2.98k stars 60 forks source link

nvim-surround.jumps bug #196

Closed kls1991 closed 1 year ago

kls1991 commented 1 year ago

Checklist

Neovim Version

0.8.1

Plugin Version

Tagged (Stable)

Minimal Configuration

Default configuration

Sample Buffer

vim.keymap.set("n", "\<tab>", "L{jzt")

use {} --cursor at begin of the line

use {}

Keystroke Sequence

ds{

Expected behavior

a pair of {} disappeard

Actual behavior

nothing

Additional context

the "{" in keymap seems make nvim-surround.jumps crazy

kls1991 commented 1 year ago

Oh my, neovim default va{ behave the same in this situation

kylechui commented 1 year ago

Please try switching to the untagged version of the plugin (by commenting out tag = '*' in your configuration, then re-installing the plugin.

kylechui commented 1 year ago

Oh my, neovim default va{ behave the same in this situation

I would also try nvim -u NONE with your test buffer, and then do va{. For me, it visually selects the curly braces.

kylechui commented 1 year ago

Ah, sorry for misreading your issue. It does seem to be a problem "upstream" with Neovim itself; you could try changing the find key for { to use Lua patterns instead, but that would also have its drawbacks (I think worse handling for escaped {, etc.)