Mercurial > vim
comparison src/evalfunc.c @ 14422:06316dbd66bc v8.1.0225
patch 8.1.0225: mode() does not indicate using CTRL-O from Insert mode
commit https://github.com/vim/vim/commit/612cc3888b136e80485132d9f997ed457dbc5501
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jul 29 15:34:26 2018 +0200
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 https://github.com/vim/vim/issues/3000)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 29 Jul 2018 15:45:05 +0200 |
parents | 631344964949 |
children | 0a69e6e708f9 |
comparison
equal
deleted
inserted
replaced
14421:2f7e67dd088c | 14422:06316dbd66bc |
---|---|
8364 * "mode()" function | 8364 * "mode()" function |
8365 */ | 8365 */ |
8366 static void | 8366 static void |
8367 f_mode(typval_T *argvars, typval_T *rettv) | 8367 f_mode(typval_T *argvars, typval_T *rettv) |
8368 { | 8368 { |
8369 char_u buf[3]; | 8369 char_u buf[4]; |
8370 | 8370 |
8371 buf[1] = NUL; | 8371 vim_memset(buf, 0, sizeof(buf)); |
8372 buf[2] = NUL; | |
8373 | 8372 |
8374 if (time_for_testing == 93784) | 8373 if (time_for_testing == 93784) |
8375 { | 8374 { |
8376 /* Testing the two-character code. */ | 8375 /* Testing the two-character code. */ |
8377 buf[0] = 'x'; | 8376 buf[0] = 'x'; |
8433 else | 8432 else |
8434 { | 8433 { |
8435 buf[0] = 'n'; | 8434 buf[0] = 'n'; |
8436 if (finish_op) | 8435 if (finish_op) |
8437 buf[1] = 'o'; | 8436 buf[1] = 'o'; |
8437 else if (restart_edit == 'I' || restart_edit == 'R' | |
8438 || restart_edit == 'V') | |
8439 { | |
8440 buf[1] = 'i'; | |
8441 buf[2] = restart_edit; | |
8442 } | |
8438 } | 8443 } |
8439 | 8444 |
8440 /* Clear out the minor mode when the argument is not a non-zero number or | 8445 /* Clear out the minor mode when the argument is not a non-zero number or |
8441 * non-empty string. */ | 8446 * non-empty string. */ |
8442 if (!non_zero_arg(&argvars[0])) | 8447 if (!non_zero_arg(&argvars[0])) |