changeset 25862:6776d3fbf13b v8.2.3465

patch 8.2.3465: cannot detect insert scroll mode Commit: https://github.com/vim/vim/commit/27fef59dd1dd75f50c366f7f616ffa4451560452 Author: zeertzjq <zeertzjq@outlook.com> Date: Sun Oct 3 12:01:27 2021 +0100 patch 8.2.3465: cannot detect insert scroll mode Problem: Cannot detect insert scroll mode. Solution: Add "scroll" to complete_info(). (closes https://github.com/vim/vim/issues/8943)
author Bram Moolenaar <Bram@vim.org>
date Sun, 03 Oct 2021 13:15:04 +0200
parents e40b9833ae39
children 420553a4d806
files runtime/doc/eval.txt src/insexpand.c src/testdir/test_popup.vim src/version.c
diffstat 4 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -3883,6 +3883,8 @@ complete_info([{what}])				*complete_inf
 		   ""		     Not in completion mode
 		   "keyword"	     Keyword completion |i_CTRL-X_CTRL-N|
 		   "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|
 		   "files"	     File names |i_CTRL-X_CTRL-F|
 		   "tags"	     Tags |i_CTRL-X_CTRL-]|
--- a/src/insexpand.c
+++ b/src/insexpand.c
@@ -68,7 +68,7 @@ static char *ctrl_x_msgs[] =
 static char *ctrl_x_mode_names[] = {
 	"keyword",
 	"ctrl_x",
-	"unknown",	    // CTRL_X_SCROLL
+	"scroll",
 	"whole_line",
 	"files",
 	"tags",
@@ -2539,7 +2539,8 @@ f_complete_check(typval_T *argvars UNUSE
     static char_u *
 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 *)"";
--- a/src/testdir/test_popup.vim
+++ b/src/testdir/test_popup.vim
@@ -990,6 +990,10 @@ func Test_popup_complete_info_01()
         \ ["\<C-X>", 'ctrl_x'],
         \ ["\<C-X>\<C-N>", '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-F>", 'files'],
         \ ["\<C-X>\<C-]>", 'tags'],
--- a/src/version.c
+++ b/src/version.c
@@ -758,6 +758,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    3465,
+/**/
     3464,
 /**/
     3463,