diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 48b4b599ae..ccf26ceb57 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1,4 +1,4 @@ -*options.txt* For Vim version 9.1. Last change: 2025 Feb 28 +*options.txt* For Vim version 9.1. Last change: 2025 Mar 01 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|. preinsert Preinsert the portion of the first candidate word that is not part of the current completion leader and using the - |hl-ComplMatchIns| highlight group. Does not work when - "fuzzy" is set. Requires both "menu" and "menuone" to be - set. + |hl-ComplMatchIns| highlight group. In order for it to + work, "fuzzy" must not bet set and "menuone" must be set. preview Show extra information about the currently selected completion in the preview window. Only works in diff --git a/src/insexpand.c b/src/insexpand.c index 8a6f8afd8f..1616a0f3f6 100644 --- a/src/insexpand.c +++ b/src/insexpand.c @@ -1985,15 +1985,15 @@ ins_compl_len(void) } /* - * 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 e91a99e7cb..a6859d5693 100644 --- a/src/testdir/test_ins_complete.vim +++ b/src/testdir/test_ins_complete.vim @@ -3223,6 +3223,11 @@ function Test_completeopt_preinsert() call assert_equal("foo1bar", getline('.')) call assert_equal(7, col('.')) + set cot=preinsert,menuone + call feedkeys("Sfoo1 foo2\f\\", '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 12d4434ec1..398d72509a 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1161, /**/ 1160, /**/