Skip to content

Commit 94a045e

Browse files
glepnirchrisbra
authored andcommitted
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 <[email protected]> Signed-off-by: zeertzjq <[email protected]> Signed-off-by: Christian Brabandt <[email protected]>
1 parent 56957ed commit 94a045e

4 files changed

Lines changed: 14 additions & 8 deletions

File tree

runtime/doc/options.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*options.txt* For Vim version 9.1. Last change: 2025 Feb 28
1+
*options.txt* For Vim version 9.1. Last change: 2025 Mar 01
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -2167,9 +2167,8 @@ A jump table for the options with a short description can be found at |Q_op|.
21672167
preinsert
21682168
Preinsert the portion of the first candidate word that is
21692169
not part of the current completion leader and using the
2170-
|hl-ComplMatchIns| highlight group. Does not work when
2171-
"fuzzy" is set. Requires both "menu" and "menuone" to be
2172-
set.
2170+
|hl-ComplMatchIns| highlight group. In order for it to
2171+
work, "fuzzy" must not bet set and "menuone" must be set.
21732172

21742173
preview Show extra information about the currently selected
21752174
completion in the preview window. Only works in

src/insexpand.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1985,15 +1985,15 @@ ins_compl_len(void)
19851985
}
19861986

19871987
/*
1988-
* Return TRUE when preinsert is set AND both 'menu' and 'menuone' flags
1989-
* are also set, otherwise return FALSE.
1988+
* Return TRUE when the 'completeopt' "preinsert" flag is in effect,
1989+
* otherwise return FALSE.
19901990
*/
19911991
static int
19921992
ins_compl_has_preinsert(void)
19931993
{
19941994
int cur_cot_flags = get_cot_flags();
1995-
return (cur_cot_flags & (COT_PREINSERT | COT_FUZZY | COT_MENU | COT_MENUONE))
1996-
== (COT_PREINSERT | COT_MENU | COT_MENUONE);
1995+
return (cur_cot_flags & (COT_PREINSERT | COT_FUZZY | COT_MENUONE))
1996+
== (COT_PREINSERT | COT_MENUONE);
19971997
}
19981998

19991999
/*

src/testdir/test_ins_complete.vim

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3223,6 +3223,11 @@ function Test_completeopt_preinsert()
32233223
call assert_equal("foo1bar", getline('.'))
32243224
call assert_equal(7, col('.'))
32253225

3226+
set cot=preinsert,menuone
3227+
call feedkeys("Sfoo1 foo2\<CR>f\<C-X>\<C-N>", 'tx')
3228+
call assert_equal("foo1", getline('.'))
3229+
call assert_equal(1, col('.'))
3230+
32263231
bw!
32273232
set cot&
32283233
set omnifunc&

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,8 @@ static char *(features[]) =
704704

705705
static int included_patches[] =
706706
{ /* Add new patch number below this line */
707+
/**/
708+
1161,
707709
/**/
708710
1160,
709711
/**/

0 commit comments

Comments
 (0)