Wednesday, February 10, 2016

How to detect i_CTRL-X submode in Vimscript?

Hello!

I have a CursorMovedI autocommand which runs some Vimscript. Unfortunately if the user is in the CTRL-X submode (of insert mode) when the autocommand fires, when the Vimscript finishes the user is left in normal mode. This doesn't happen if the completion popup is already visible; only if the user has invoked the submode but done nothing further.

I'm assuming it's not possible to avoid the submode being exited during the course of the Vimscript execution. So I'd like to detect this situation and then restore the mode at the end of the Vimscript.

How then can I detect if the user is in the i_CTRL-X submode? (The mode() function doesn't tell me.)

Many thanks in advance,

Andrew Stewart

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: