Paul Jolly wrote:

> > I'm seeing some some instances of not getting callbacks via
> > SafeStateAgain... but I'll have to investigate that later.
> 
> This was actually my mistake; state() returns 'c' when in a channel
> callback handler. If that is the only state, then it is safe for me to
> immediately schedule the work. But for now I've switched to evaluating
> state('w') to be more specific to waiting state.
> 
> However I am seeing a situation where neither SafeState nor
> SafeStateAgain are being triggered.
> 
> The sequence looks like this:
> 
> 1. mouse move triggers call of function that calls ch_evalexpr into govim
> 2. govim calls back into Vim to evaluate an expression; this returns
> 3. govim calls Vim to schedule some work; it's not safe at this point
> because the ch_evalexpr in 1 is still blocked; so this work is queued
> and we register an autocommand for SafeState,SafeStateAgain
> 4. govim calls back into Vim (as part of same call from 1) to
> create_popup; this returns
> 5. govim calls back into Vim to redraw; this returns
> 6. the ch_evalexpr from 1 returns, and the function returns
> 
> However at this point, we do not receive a SafeState or SafeStateAgain
> autocommand event. So everything blocks (because my govim test is
> waiting)
> 
> Any ideas, Bram?

How does the mouse move trigger the sequence?  It's when returning from
this that SafeStateAgain should be triggered.  But that currently only
happens when checking channels for messages.  That should be
encountered, since you have channels, but perhaps the safe flag got
reset without anything causing Vim to return to the main loop?

Let me add some log statements so you can see what happens to the state.

-- 
Error:015 - Unable to exit Windows.  Try the door.

 /// 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/201909171824.x8HIOXJW025051%40masaka.moolenaar.net.

Raspunde prin e-mail lui