patch 9.1.1161: preinsert requires bot "menu" and "menuone" to be set
Problem: preinsert requires bot "menu" and "menuone" to be set,
but "menu" is redundant (after v9.1.1160)
Solution: preinsert only requires menuone (glepnir)
closes: #16763
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/insexpand.c b/src/insexpand.c
index 8a6f8af..1616a0f 100644
--- a/src/insexpand.c
+++ b/src/insexpand.c
@@ -1985,15 +1985,15 @@
}
/*
- * Return TRUE when preinsert is set AND both 'menu' and 'menuone' flags
- * are also set, otherwise return FALSE.
+ * Return TRUE when the 'completeopt' "preinsert" flag is in effect,
+ * otherwise return FALSE.
*/
static int
ins_compl_has_preinsert(void)
{
int cur_cot_flags = get_cot_flags();
- return (cur_cot_flags & (COT_PREINSERT | COT_FUZZY | COT_MENU | COT_MENUONE))
- == (COT_PREINSERT | COT_MENU | COT_MENUONE);
+ return (cur_cot_flags & (COT_PREINSERT | COT_FUZZY | COT_MENUONE))
+ == (COT_PREINSERT | COT_MENUONE);
}
/*
diff --git a/src/testdir/test_ins_complete.vim b/src/testdir/test_ins_complete.vim
index e91a99e..a6859d5 100644
--- a/src/testdir/test_ins_complete.vim
+++ b/src/testdir/test_ins_complete.vim
@@ -3223,6 +3223,11 @@
call assert_equal("foo1bar", getline('.'))
call assert_equal(7, col('.'))
+ set cot=preinsert,menuone
+ call feedkeys("Sfoo1 foo2\<CR>f\<C-X>\<C-N>", 'tx')
+ call assert_equal("foo1", getline('.'))
+ call assert_equal(1, col('.'))
+
bw!
set cot&
set omnifunc&
diff --git a/src/version.c b/src/version.c
index 12d4434..398d725 100644
--- a/src/version.c
+++ b/src/version.c
@@ -705,6 +705,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1161,
+/**/
1160,
/**/
1159,