On 2 July 2017, Yegappan Lakshmanan <yegapp...@gmail.com> wrote: > Hi, > > On Sun, Jul 2, 2017 at 12:11 PM, LCD 47 <lcd...@gmail.com> wrote: > >> >> > >> >> When one plugin is asynchronously updating a quickfix list, > >> >> currently it is not possible for another plugin to update another > >> >> quickfix list synchronously or asynchronously using the cexpr, > >> >> cfile, and other commands. The setqflist() function can update any > >> >> quickfix list in the stack. But this function currently doesn't > >> >> support parsing output using 'errorformat'. > >> >> > >> >> For example, let us say one plugin asynchronously updates the > >> >> quickfix list with a build tool output. Now if the user runs a > >> >> query command to create and update another quickfix list, then both > >> >> the plugins will end up updating the same quickfix list. > >> > > >> > What do you mean by "asynchronously" in this context? Vim is > >> > single threaded, as far as I can tell there is no way to run f.i. > >> > two cexpr commands at the same time. Do you have an ecxample of > >> > code that fails this way? > >> > > >> > >> A plugin can use ":caddexpr" command to add entries to a quickfix > >> list. For example, a plugin can start a build process (which > >> takes a long time to complete) in the background using the job > >> functionality. As the output lines are available, the plugin can use > >> caddexpr to parse the output and add the resulting entries to the > >> quickfix list. > >> > >> While this is running, if the user issues another command (either > >> from another plugin or directly using the Vim quickfix commands) that > >> creates/updates the quickfix list then the wrong quickfix list will be > >> updated by the previous command. This is because the caddexpr command > >> can add entires only to the last quickfix list in the stack. > > > > Ok, so the problem is not cexpr, which creates the full quickfix > > list in a single run, but rather interspersed calls to caddexpr (and > > friends) from different plugins, each plugin trying to update its > > own quickfix list on the fly. > > > > Yes. > > > > > Then perhaps what's missing is a set of functions that can create / edit > > / delete quickfix lists outside the stack altogether. > > > > This is already possible using the setqflist() function. A particular > quickfix list can be updated by specifying the list number using the > "nr" key in the dictionary.
setqflist() affects quickfix lists on the stack. I'm talking about lists in memory, unrelated to the stack. > You can add entries using the "items" key. The missing functionality > is parsing output using 'errorformat'. /lcd -- -- 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 vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.