kylechui / nvim-surround

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

changing surround pair changes indentation #46

Closed jemag closed 2 years ago

jemag commented 2 years ago

Test case:

fun (
  "test"
  "test"
  "test"
  "test"
  "test"
)

with spaces before each "test". Hitting cs"' inside the " of the first test will result in the following change in indentation:

fun (
    'test'
    "test"
    "test"
  "test"
  "test"
)

Similarly, doing it on the last test will result in :

fun (
  "test"
  "test"
  "test"
  "test"
  'test'
  )
kylechui commented 2 years ago

@jemag Just as a question, were you in any particular file type when this bug occurred? Or just in a scratch buffer?

jemag commented 2 years ago

@kylechui just a normal .txt file that I created for testing. It doesn't change the indention anymore since the fix was merged.