{
if (compl_shows_dir_forward() && compl_shown_match->cp_next != NULL)
{
- compl_shown_match = !compl_fuzzy_match ? compl_shown_match->cp_next
- : find_comp_when_fuzzy();
+ compl_shown_match = compl_fuzzy_match && compl_match_array != NULL
+ ? find_comp_when_fuzzy() : compl_shown_match->cp_next;
found_end = (compl_first_match != NULL
&& (is_first_match(compl_shown_match->cp_next)
|| is_first_match(compl_shown_match)));
&& compl_shown_match->cp_prev != NULL)
{
found_end = is_first_match(compl_shown_match);
- compl_shown_match = !compl_fuzzy_match ? compl_shown_match->cp_prev
- : find_comp_when_fuzzy();
+ compl_shown_match = compl_fuzzy_match && compl_match_array != NULL
+ ? find_comp_when_fuzzy() : compl_shown_match->cp_prev;
found_end |= is_first_match(compl_shown_match);
}
else
call feedkeys("S\<C-x>\<C-o>fb\<C-n>", 'tx')
call assert_equal('fooBaz', g:word)
+ " avoid break default completion behavior
+ set completeopt=fuzzy,menu
+ call setline(1, ['hello help hero h'])
+ exe "norm! A\<C-X>\<C-N>"
+ call assert_equal('hello help hero hello', getline('.'))
+ set completeopt+=noinsert
+ call setline(1, ['hello help hero h'])
+ exe "norm! A\<C-X>\<C-N>"
+ call assert_equal('hello help hero h', getline('.'))
+
" clean up
set omnifunc=
bw!