wincent / terminus

🖥 Enhanced terminal integration for Vim
BSD 2-Clause "Simplified" License
463 stars 25 forks source link

Fix calling autocmd while in omnifunc completion #18

Closed barlik closed 7 years ago

barlik commented 7 years ago

<c-o> doesn't escape insert mode when used with omnifunc completion. Instead, use <c-\><c-o> to switch to normal mode. Edit: fix wrong escaping

wincent commented 7 years ago

Thanks @barlik. This seems like a harmless enough change, so I am happy to merge it, but I'd like to understand the problem that it fixes. I know from the help the difference between the two bindings:

CTRL-O      execute one command, return to Insert mode   *i_CTRL-O*
CTRL-\ CTRL-O   like CTRL-O but don't move the cursor        *i_CTRL-\_CTRL-O*

but I'd like to know how the problem you were seeing manifests in practice. How would I repro it?

barlik commented 7 years ago

In order to test the behaviour, you need to have omnifunc defined. There are a couple of filetype plugins provided by vim that use omnifunc, for example you can pick html.

Steps to replicate:

wincent commented 7 years ago

Excellent. Thanks for the clarification!

wincent commented 7 years ago

Merged this onto the next branch. Thanks!