File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff 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
19921992ins_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/*
Original file line number Diff line number Diff 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 &
Original file line number Diff line number Diff line change @@ -704,6 +704,8 @@ static char *(features[]) =
704704
705705static int included_patches [] =
706706{ /* Add new patch number below this line */
707+ /**/
708+ 1161 ,
707709/**/
708710 1160 ,
709711/**/
You can’t perform that action at this time.
0 commit comments