machakann / vim-sandwich

Set of operators and textobjects to search/select/edit sandwiched texts.
1.44k stars 37 forks source link

Make sure that visualrepeat#set function exists before calling it #148

Closed smjonas closed 2 years ago

smjonas commented 2 years ago

Closes #147.

machakann commented 2 years ago

Thanks. I have checked out the PR and also #147. The problem is that an autoload function such as visualrepeat#set does not exist until it is called for the first time. As a result, visualrepeat#set would never be called with this PR unless another plugin called the function. In principle, the existence check of an autoload function is difficult, and it cannot be achieved only by exists().

Actually, I have not understood why neovim throws the error yet, but I will search for another way to solve the problem.

smjonas commented 2 years ago

Thank you, actually I have now found a way to avoid this problem entirely (by simply ignoring errors that occur during the command execution), so this is not a high priority issue for me anymore. If you think you can solve it, that would be great of course! Otherwise I wouldn't mind if you closed it :)

machakann commented 2 years ago

Solved by 74898e6f5c5ea37e17163f00bf4981049f785eed