0
0
mirror of https://github.com/vim/vim.git synced 2025-10-06 05:44:14 -04:00

patch 8.2.3465: cannot detect insert scroll mode

Problem:    Cannot detect insert scroll mode.
Solution:   Add "scroll" to complete_info(). (closes #8943)
This commit is contained in:
zeertzjq
2021-10-03 12:01:27 +01:00
committed by Bram Moolenaar
parent 8b8c0ed657
commit 27fef59dd1
4 changed files with 11 additions and 2 deletions

View File

@@ -3883,6 +3883,8 @@ complete_info([{what}]) *complete_info()*
"" Not in completion mode "" Not in completion mode
"keyword" Keyword completion |i_CTRL-X_CTRL-N| "keyword" Keyword completion |i_CTRL-X_CTRL-N|
"ctrl_x" Just pressed CTRL-X |i_CTRL-X| "ctrl_x" Just pressed CTRL-X |i_CTRL-X|
"scroll" Scrolling with |i_CTRL-X_CTRL-E| or
|i_CTRL-X_CTRL-Y|
"whole_line" Whole lines |i_CTRL-X_CTRL-L| "whole_line" Whole lines |i_CTRL-X_CTRL-L|
"files" File names |i_CTRL-X_CTRL-F| "files" File names |i_CTRL-X_CTRL-F|
"tags" Tags |i_CTRL-X_CTRL-]| "tags" Tags |i_CTRL-X_CTRL-]|

View File

@@ -68,7 +68,7 @@ static char *ctrl_x_msgs[] =
static char *ctrl_x_mode_names[] = { static char *ctrl_x_mode_names[] = {
"keyword", "keyword",
"ctrl_x", "ctrl_x",
"unknown", // CTRL_X_SCROLL "scroll",
"whole_line", "whole_line",
"files", "files",
"tags", "tags",
@@ -2539,7 +2539,8 @@ f_complete_check(typval_T *argvars UNUSED, typval_T *rettv)
static char_u * static char_u *
ins_compl_mode(void) ins_compl_mode(void)
{ {
if (ctrl_x_mode == CTRL_X_NOT_DEFINED_YET || compl_started) if (ctrl_x_mode == CTRL_X_NOT_DEFINED_YET || ctrl_x_mode == CTRL_X_SCROLL
|| compl_started)
return (char_u *)ctrl_x_mode_names[ctrl_x_mode & ~CTRL_X_WANT_IDENT]; return (char_u *)ctrl_x_mode_names[ctrl_x_mode & ~CTRL_X_WANT_IDENT];
return (char_u *)""; return (char_u *)"";

View File

@@ -990,6 +990,10 @@ func Test_popup_complete_info_01()
\ ["\<C-X>", 'ctrl_x'], \ ["\<C-X>", 'ctrl_x'],
\ ["\<C-X>\<C-N>", 'keyword'], \ ["\<C-X>\<C-N>", 'keyword'],
\ ["\<C-X>\<C-P>", 'keyword'], \ ["\<C-X>\<C-P>", 'keyword'],
\ ["\<C-X>\<C-E>", 'scroll'],
\ ["\<C-X>\<C-Y>", 'scroll'],
\ ["\<C-X>\<C-E>\<C-E>\<C-Y>", 'scroll'],
\ ["\<C-X>\<C-Y>\<C-E>\<C-Y>", 'scroll'],
\ ["\<C-X>\<C-L>", 'whole_line'], \ ["\<C-X>\<C-L>", 'whole_line'],
\ ["\<C-X>\<C-F>", 'files'], \ ["\<C-X>\<C-F>", 'files'],
\ ["\<C-X>\<C-]>", 'tags'], \ ["\<C-X>\<C-]>", 'tags'],

View File

@@ -757,6 +757,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
3465,
/**/ /**/
3464, 3464,
/**/ /**/