kylechui / nvim-surround

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

Remove logic that may not be useful #302

Closed weartist closed 5 months ago

weartist commented 5 months ago

It seems that this judgment will always be followed by the result

kylechui commented 5 months ago

That code is to check if the normal-mode delimiters are already in cache, and only fetch them if they are not in cache.

weartist commented 5 months ago

That code is to check if the normal-mode delimiters are already in cache, and only fetch them if they are not in cache.

But here's a judgment, if it is executed, it must be worthless? https://github.com/kylechui/nvim-surround/blob/0c02c52182a9c2a7fa7e122b4037f6408e98434a/lua/nvim-surround/init.lua#L283

kylechui commented 5 months ago

Woops, completely missed that. Thanks for the catch!