Ingo Karkat wrote:
> On 29/01/2021 21:07, Bram Moolenaar wrote: > > > > Patch 8.2.2426 Problem: Allowing 'completefunc' to switch > > windows causes trouble. Solution: use "textwinlock" instead of > > "textlock". Files: src/insexpand.c, > > src/testdir/test_ins_complete.vim, src/testdir/test_popup.vim > > I hope that use of win_execute() is still possible during completion, > right? You already had disabled window switching once in 8.2.0614, and > after I complained in https://github.com/vim/vim/issues/6017 you again > allowed switching as long as it returned to the original window. I forgot about that. And frankly, reading it again I don't quite understand why I allowed window switching. If someone has autocommands setup, it an fail miserably. As I mentioned: "It's not trivial, I hope it will allow enough without allowing too much". So now we found another case where it causes trouble. I'm not sure if we can keep fixing every problem we find. > Many of my completion plugins use window switching, and I never had > any issues reported because of it, so it's sad that you now decide it > has to be disallowed in general, just because _some_ code _can_ > misbehave. As long as win_execute() can be used (and that does offer > some minor benefits over :wincmd w), I can adapt the plugin code (but > will then have to either drop old Vim versions that don't have it, or > keep maintaining the existing implementation in parallel). I don't like existing plugins to fail, but I also don't want a misbehaving plugin to cause trouble. In case a complete function bails out and doesn't restore the window, what to do? Restoring the window after the function returns might be best, but that might fail too (again, because of autocommands). Perhaps we should disable autocommands while in the complete function? It's getting too complicated... So, what functionality is missing to do what you want without actually switching windows? -- Two fish in a tank. One says to the other: "Do you know how to drive this thing?" /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org /// -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/202101292114.10TLEXvJ469402%40masaka.moolenaar.net.
