Mercurial > vim
diff src/evalfunc.c @ 10787:09926123316b v8.0.0283
patch 8.0.0283: mode() does not indicate Insert mode completion
commit https://github.com/vim/vim/commit/e90858d0229444b3cd16b1cd3a8d61a24c435705
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Feb 1 17:24:34 2017 +0100
patch 8.0.0283: mode() does not indicate Insert mode completion
Problem: The return value of mode() does not indicate that completion is
active in Replace and Insert mode. (Zhen-Huan (Kenny) Hu)
Solution: Add "c" or "x" for two kinds of completion. (Yegappan Lakshmanan,
closes #1397) Test some more modes.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 01 Feb 2017 17:30:05 +0100 |
parents | a7789921b514 |
children | 5780bd3a5a7e |
line wrap: on
line diff
--- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -7783,21 +7783,26 @@ f_mode(typval_T *argvars, typval_T *rett } else #endif - if (State & REPLACE_FLAG) - buf[0] = 'R'; - else - buf[0] = 'i'; - } - else if (State & CMDLINE) + { + if (State & REPLACE_FLAG) + buf[0] = 'R'; + else + buf[0] = 'i'; +#ifdef FEAT_INS_EXPAND + if (ins_compl_active()) + buf[1] = 'c'; + else if (ctrl_x_mode == 1) + buf[1] = 'x'; +#endif + } + } + else if ((State & CMDLINE) || exmode_active) { buf[0] = 'c'; - if (exmode_active) + if (exmode_active == EXMODE_VIM) buf[1] = 'v'; - } - else if (exmode_active) - { - buf[0] = 'c'; - buf[1] = 'e'; + else if (exmode_active == EXMODE_NORMAL) + buf[1] = 'e'; } else {