mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 11:58:17 +00:00
vim-patch:9.1.1272: completion: in keyword completion Ctrl_P cannot go back after Ctrl_N
Problem: completion: in keyword completion Ctrl_P cannot go back after Ctrl_N Solution: in find_compl_when_fuzzy() always return first match of array, after Ctrl_P use compl_shown_match->cp_next instead of compl_first_match. (glepnir) closes: vim/vim#170433e50a28a03
Co-authored-by: glepnir <glephunter@gmail.com> (cherry picked from commitb01921cb55
)
This commit is contained in:

committed by
github-actions[bot]
![github-actions[bot]](/assets/img/avatar_default.png)
parent
02bf23b4bf
commit
e3506ede27
@@ -3944,7 +3944,7 @@ static compl_T *find_comp_when_fuzzy(void)
|
||||
if ((is_forward && compl_selected_item == compl_match_arraysize - 1)
|
||||
|| (is_backward && compl_selected_item == 0)) {
|
||||
return compl_first_match != compl_shown_match
|
||||
? compl_first_match
|
||||
? (is_forward ? compl_shown_match->cp_next : compl_first_match)
|
||||
: (compl_first_match->cp_prev ? compl_first_match->cp_prev : NULL);
|
||||
}
|
||||
|
||||
|
@@ -2886,6 +2886,8 @@ func Test_complete_fuzzy_match()
|
||||
call assert_equal('bar', getline('.'))
|
||||
call feedkeys("Sb\<C-X>\<C-N>\<C-Y>\<ESC>", 'tx')
|
||||
call assert_equal('blue', getline('.'))
|
||||
call feedkeys("Sb\<C-X>\<C-P>\<C-N>\<C-Y>\<ESC>", 'tx')
|
||||
call assert_equal('b', getline('.'))
|
||||
|
||||
" clean up
|
||||
set omnifunc=
|
||||
|
Reference in New Issue
Block a user