Closed telemachus closed 10 months ago
Yes, you are right that that is your error. Basically the behavior for nvim-surround
tries to closely follow the default behavior in Neovim itself. If you do va(
, Neovim will start from the cursor and select any surrounding parenthesis pair, or jump to the next one if none surrounds the cursor (including across lines). By default, Neovim does not recognize quotes on multiple lines as a "surrounding pair" (e.g. try va"
), so neither does nvim-surround
. You can get the desired behavior by using Lua patterns to match for double/single quotes (see the default config/help docs for more info), but this will cause issues with escaped quotes etc.
Checklist
:h nvim-surround
to see if there might be any relevant information there?Neovim Version
NVIM v0.10.0-dev-1744+g0d885247b
Plugin Version
Nightly (Beta)
Minimal Configuration
Sample Buffer
Keystroke Sequence
With the cursor inside of the two-line double quote:
With the cursor inside of the two-line single quote:
Expected behavior
I expect the change command to find the quotes on both lines and change them. (This is what happens if you run
cs)*
orcs]*
on the other multi-line pairs.)Actual behavior
A search is triggered. For example, if you put the cursor on the first "This" inside one of the two-line quotes, and try the change command, neovim runs a search for
/\<This\>
and highlights all the items found.Additional context
I doubt it matters, but I'm on macOS 14.1.2.
In the docs for jumps (section 2.5), there's this note:
Maybe my problem is related to this?