0
0
mirror of https://github.com/vim/vim.git synced 2025-10-13 06:54:15 -04:00

patch 8.1.0225: mode() does not indicate using CTRL-O from Insert mode

Problem:    Mode() does not indicate using CTRL-O from Insert mode.
Solution:   Add "niI", "niR" and "niV" to mode() result. (closes #3000)
This commit is contained in:
Bram Moolenaar
2018-07-29 15:34:26 +02:00
parent 91f84f6e11
commit 612cc3888b
4 changed files with 51 additions and 26 deletions

View File

@@ -8366,10 +8366,9 @@ f_mkdir(typval_T *argvars, typval_T *rettv)
static void
f_mode(typval_T *argvars, typval_T *rettv)
{
char_u buf[3];
char_u buf[4];
buf[1] = NUL;
buf[2] = NUL;
vim_memset(buf, 0, sizeof(buf));
if (time_for_testing == 93784)
{
@@ -8435,6 +8434,12 @@ f_mode(typval_T *argvars, typval_T *rettv)
buf[0] = 'n';
if (finish_op)
buf[1] = 'o';
else if (restart_edit == 'I' || restart_edit == 'R'
|| restart_edit == 'V')
{
buf[1] = 'i';
buf[2] = restart_edit;
}
}
/* Clear out the minor mode when the argument is not a non-zero number or