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

tests: Use a consistent `shiftwidth` in tests #81

Closed Gelio closed 2 years ago

Gelio commented 2 years ago

When running the tests using <Plug>PlenaryTestFile the shiftwidth option was inherited from the user's config. For users that modified shiftwidth in their configuration the tests were failing. One of the tests ("nvim-surround can visual-line surround") indented a line while doing a surround but due to a different shiftwidth, the size of the indent did not match the expected 4 spaces.

image

This change makes all tests pass:

image

It is possible that other indent-related options should also be set so the tests behave consistently. expandtab comes to my mind.