> > > With my limited understanding of the Vim internals it feels like Vim > > should be calling `listener_flush` before any autocommand events are > > fired. Or does that not make sense? > > I don't see why there would be any relation between triggering an > autocommand and the listener mechanism. They are completely separate > things. The listeners only depend on changes in the buffer text, not > how how those changes are made. >
There isn't a relationship per se, but for remote plugins, as I described in this issue, if there are pending deltas when an autocommand is fired (or a function called for that matter) where there is a remote plugin handling the autocommand (or function) then there is a chance, as we discovered, for effectively performing a "dirty write" back to Vim. We can, however, put such a call into our VimScript shim ( https://github.com/govim/govim/blob/db2f5323507e94805d5d9f2bc4771f29a1e3f8e0/plugin/govim.vim) for now and experiment there. > > You can perhaps call listener_flush() somewhere to have the callback > > > invoked earlier. > > > > This works for now, thank you. > > If a plugin depends on listener callbacks to be invoked before something > else happens, the flushing is the right way. > The plugin relies on events being in the right order. i.e. that the edits happened before the CompleteDone event was triggered (more explicitly, the buffer contents at the time of the event reflect the changes but a listener_add callback does not, at this point know about them) But as I said above, we can experiment with a workaround in our shim for now. -- -- 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/CACoUkn73xwfenVssMwQ-h6VyH0WP1Qym23RdCZjEtKHa-tg%2BzA%40mail.gmail.com.
