> It would only be triggered when Vim is not halfway a mapping, ":normal",
> feedkeys(), autocommand, etc.

Perfect.

> There will be no "leave", because the user then already typed something
> and I don't see what you can do.  Perhaps what you want is a way to
> obtain the status, thus after triggering the event Vim would keep this
> "safe" state until input is found (other then processing messages).
> Hmm, when invoking a callback you would be temporarily outside of this
> "safe" state, since you are executing a sequence of commands, but that's
> where you would check...  That's a catch 22.

Yeh this is where I think it gets tricky. But I think we could treat
the "obtaining of the status" as an optimisation that we don't
necessarily need. Reason being, if the handling of a message from
govim is itself treated as "unsafe", then we know we will get a "safe"
autocommand callback soon after. So the command/whatever we were asked
to "schedule" by govim will simply happen a tiny bit later than if
were were able to query the "safe" state. Would that work?

> > I think we would also need a way to ask "are there any current
> > autocommands?". The logic would become:
>
> Why autocommands?  We also have callbacks that might be busy.

You're quite right; for some reason I unnecessarily constrained my
thinking to autocommands.

> What if another plugin is doing a ch_evalexpr()?  I suppose that doesn't
> interfere with what your plugin is doing.

It could/would interfere... and it's a problem with the approach I've
described, that's for sure because all I'm doing is:

  let s:activeGovimCalls += 1
  let l:resp = ch_evalexpr(s:channel, a:args)
  let s:activeGovimCalls -= 1

Clearly I can't "control" ch_evalexpr calls in any other plugins.

So generally speaking, I think we need some help from Vim itself here:
either to keep track of ch_evalexpr calls (and anything else?) or by
fleshing out the "safe" autocommand above. Or maybe both?

Thanks

-- 
-- 
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/CACoUkn4%3DBn-nOP1TH4NOgWiDBfOSP76DWXmCHC31Vg%3DxHSchuw%40mail.gmail.com.

Raspunde prin e-mail lui