Why does mini.surround behave like this? #661
-
If I do |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Because quotes in 'mini.surround' are not balanced by default. I don't quite remember the actual reason why this is the default, but it was deliberate (there is explicit test for that). My current reasoning is that all three quotes are not balanced pairs (they use same open and close characters) and I can see them closely to any other default surrounding (which is not balanced). Not very strong reason, I admit, but it is what it is now (as breaking change is bad). Besides, you can modify them to be balanced like this: require('mini.surround').setup({
custom_surroundings = {
['"'] = { input = { '%b""', '^.().*().$' } },
},
search_method = 'cover_or_next',
}) |
Beta Was this translation helpful? Give feedback.
Because quotes in 'mini.surround' are not balanced by default. I don't quite remember the actual reason why this is the default, but it was deliberate (there is explicit test for that). My current reasoning is that all three quotes are not balanced pairs (they use same open and close characters) and I can see them closely to any other default surrounding (which is not balanced). Not very strong reason, I admit, but it is what it is now (as breaking change is bad).
Besides, you can modify them to be balanced like this: