Hi, On Thu, Apr 30, 2020 at 9:02 AM Ingo Karkat <[email protected]> wrote:
> *Describe the bug* > :help E840 <https://vimhelp.appspot.com/insert.txt.html#E840> (under :help > complete-items > <https://vimhelp.appspot.com/insert.txt.html#complete-items>) reads > > The function is not allowed to move to another window or delete text. > > Previously, *move to another window* meant that after the completefunc > finishes, the current window has to be the same as the original one (where > the completion was triggered). *Temporarily* switching windows (and going > back) used to work fine. Since this change: > > commit ff06f28 > <https://github.com/vim/vim/commit/ff06f283e3e4b3ec43012dd3b83f8454c98f6639> > Author: Bram Moolenaar [email protected] > Date: 2020-04-21 22:01:14 +0200 > > patch 8.2.0614: get ml_get error when deleting a line in 'completefunc' > > *Expected behavior* > I understand the motivation to prevent unexpected changes during > completion. However, switching to other windows *temporarily* should be > harmless, is convenient to implement custom completions [1], and sometimes > even necessary [2]. > > 1. In an attempt to simplify the implementation of custom completions, > my CompleteHelper plugin > <http://www.vim.org/scripts/script.php?script_id=3914> searches other > windows in order to offer the same functionality as :set complete+=w. > 2. In many cases, the matching of completion candidates could be done > without going to the corresponding window (e.g. using getbufline()), > but as matching in the current buffer usually is done via search(), it > is convenient to reuse that simple implementation for other windows as > well. I have some completions like the MotionComplete plugin > <http://www.vim.org/scripts/script.php?script_id=4265> that uses a > queried {motion} to obtain matches. That could *not* be emulated via > low-level string-matching functions, but really has to be executed in that > buffer. (And in order to use other windows as sources, it has to go there.) > > Instead of switching to the window, if you use the win_execute() function to run a command in a particular window from the custom complete function, does this error happen? - Yegappan -- -- 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/CAAW7x7kRYWYNhSTg94zQFHNEdqLx0F5v2Rb%3DvrckeCZi_TvN7g%40mail.gmail.com.
