-
-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Breaking Changes: Following main
#77
Comments
As of #66, the default behavior for handling invalid keys into the delimiter table is no longer to surround using the key on the left and right hand side, but rather to throw an error message. For more information, see require("nvim-surround").setup({
delimiters = {
invalid_key_behavior = function(char)
return { char, char }
end,
}
}) |
Forgot to mention this (sorry!), but also as of #66, the provided function |
As of #92, the default keymaps for normal-mode surrounds have had their names changed:
The new naming scheme reflects that |
With the introduction of #113, quite a few breaking changes have been introduced. Configuration
Please see the default configuration and Behavior
Old text Command New text
some_text ysiw| |some_text|
|some_text| ds| some_text
|some_text| cs|b (some_text)
|
With the introduction of #136, some configuration options have been renamed to better reflect their actual purpose:
-- Old configuration
require("nvim-surround.config").get_selection({
textobject = ")",
})
-- New configuration
require("nvim-surround.config").get_selection({
motion = "a)",
}) |
As of 87839e1, "smart" quotes have now been removed from -- Original text
local str = "This string has "invalid quo*tes" in it!"
-- Old behavior (jumps to the second pair and deletes)
local str = "This string has "invalid quotes in it!
-- New behavior (doesn't jump, deleting the immediate surrounding pair)
local str = "This string has invalid quotes in it!" Please see #153 for the rationale behind this decision. |
Note: If your configuration does not define As of ebdd22d, custom require("nvim-surround").setup({
surrounds = {
invalid_key_behavior = {
add = function(char) -- This function now accepts control chars
return { { char }, { char } }
end
}
-- Note that there is no surround for <CR>
}
} Then word
-- ysiw<CR>
^Mword^M |
I will be using this thread as the main place to notify users of breaking changes, so subscribe to this issue to stay up to date about changes that may affect your configuration. Furthermore, breaking commits will be flagged with a
!
, e.g.refactor!: ...
, so if you notice one of those commit messages when updating, refer to this issue.Thanks to everybody for using this plugin, and sorry for the inconvenience!
The text was updated successfully, but these errors were encountered: