Nikolay Pavlov wrote:

> 2015-06-13 17:02 GMT+03:00 AA <[email protected]>:
> > When I update the statusline from a python thread forked from main, the 
> > update gets registered by vim but is shown only after take an action, a 
> > movement using keys, or a mouse scroll.
> >
> > Python code here if it helps: http://sprunge.us/LCfM  (Open in vim followed 
> > by :pyfile %)
> >
> > Briefly: Spawn threads, each threads sleeps for a while and then updates 
> > the statusline. Don't do anything and you'll never notice the update. Keep 
> > j/k pressed and all updates show fine.
> >
> > So my question is: Is there a way in which I can make the status updates 
> > immediate, without requiring any user action?
> 
> Vim is not thread-safe. You *must not* update statusline in another
> thread, especially doing this using `set statusline` command (there is
> also a variant where you use `vim.options` and/or {window}.options
> ({window}: object from vim.windows or vim.current.window)). Most
> likely after some time this code is running you will get a crash
> because Vim is using many globals (using .options will touch much less
> amount of globals compared to vim.command('set statusline=' …)).
> 
> Another bad idea was using Python code using :pyfile. This command
> pushes all variables/functions defined in the sourced file into global
> namespace so with big amount of plugins that use :pyfile you will
> definitely run into problems.

It should be possible to make a message queue, like we process netbeans
requests.  Only the queue itself needs to be thread-safe.

The messages could be Ex commands or expressions.  They are handled
while waiting for a character to be typed.

Should be fairly simple.  We do need something to wake up select() or
poll().

Since the Python interface is quite well worked out (Nikolay did a lot
of work on it :-), and Python supports spawning processes and threads,
this should allow for most asynchronous things.

-- 
hundred-and-one symptoms of being an internet addict:
98. The Alta Vista administrators ask you what sites are missing
    in their index files.

 /// 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].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui