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

`ysj` not doing the line motion but area motion #208

Closed pedro757 closed 1 year ago

pedro757 commented 1 year ago

Checklist

Neovim Version

NVIM v0.9.0-dev-869+g964ae205a Build type: RelWithDebInfo LuaJIT 2.1.0-beta3

Plugin Version

Tagged (Stable)

Minimal Configuration

default

Sample Buffer

I have this text file, and my cursor is here | let's say
then I want to surround these two lines with parenthesis

Keystroke Sequence

ysj(

Expected behavior

( I have this text file, and my cursor is here | let's say
then I want to surround these two lines with parenthesis )

Actual behavior

I have this text file, and my cursor is here ( | let's say
then I want to surround these two lines with parenthesis )

Additional context

This is not consistent with the neovim ecosystem, let's consider the yank motion, if I do yj it will yank the current line and the next one, that should be the default, then if you need a more specific (certain area) surround you can use visual mode and surround the selected area.

Note: it's the same with count motions i.e. ys4j(

kylechui commented 1 year ago

The latest commit should resolve the bug, and introduces two new tests to ensure that it remains that way. Please feel free to re-open if this doesn't address the problem, and thanks for contributing!

pedro757 commented 1 year ago

Thank you.