> > Does this sound OK? > > I decided to give it a go and did an implementation of SafeState. > It triggers in Normal, Insert and Command-line mode when nothing is > pending. And when a blocking channel call has been made, where the > state was safe before blocking, so that when something is postponed it > can be handled afterwards. > > It may be that we need to check more conditions whether it is actually > "safe". And some things depend on what the requirements for "safe" are. > E.g. currently it is not checking for Visual mode, you can use mode() > for that. And it doesn't check whether the screen is scrolled (not sure > how you would check for that, might need the state() function). > > When SafeState is triggered after the blocking channel call, we are in > the input loop, thus no screen update will take place. You can use > :redraw, but in Command-line mode that might not work well. > > Anyway, please try it out, so we can decide whether we can keep > SafeState, modify it, or perhaps drop it.
Thanks, Bram. Sorry, not been able to keep up with the threads and progress! Very keen to give this a try, thanks. Two questions. Firstly, is there still a plan for the safeState/state/whatever function? Because without it, if a message arrives at a "safe" time we need something unsafe to happen before it will be run? Secondly, in the following situation, when does SateState get triggered? 1. user makes change in insert mode 2. listener_add callback fires and make ch_evalexpr call 3. Vim receives and handles a channel-based message; let's just assume we put this work onto a pending queue (in the absence of safeState()) 4. ch_evalexpr returns 5. the listener_add callback returns I'm assuming the answer is "after step 5" - but is it immediately after the listener_add callback returns? Thanks, Paul -- -- 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/CACoUkn4kPmXAmjzvJnrSKqCJBcGh-XCE%2BaUpeZs-8Q3Psu824A%40mail.gmail.com.
