diff --git a/src/fuzzy.c b/src/fuzzy.c index b6d595a700..c8709c1079 100644 --- a/src/fuzzy.c +++ b/src/fuzzy.c @@ -865,11 +865,15 @@ search_for_fuzzy_match( } else { - if (fuzzy_match_str(*ptr, pattern) != FUZZY_SCORE_NONE) + char_u *line = *ptr; + char_u *p = skipwhite(line); + if (fuzzy_match_str(p, pattern) != FUZZY_SCORE_NONE) { found_new_match = TRUE; *pos = current_pos; - *len = (int)ml_get_buf_len(buf, current_pos.lnum); + *ptr = p; + *len = (int)ml_get_buf_len(buf, current_pos.lnum) - + (int)(p - line); break; } } diff --git a/src/testdir/test_ins_complete.vim b/src/testdir/test_ins_complete.vim index fbfb45e2f3..7eda457e1a 100644 --- a/src/testdir/test_ins_complete.vim +++ b/src/testdir/test_ins_complete.vim @@ -3696,10 +3696,16 @@ func Test_complete_opt_fuzzy() call feedkeys("Goa\\\", 'tx') call assert_equal('aaaa', getline('.')) + %d + set autoindent + set completeopt=menuone,fuzzy + call feedkeys("A\hello world\word is on fire\w\\\", 'tx') + call assert_equal("\thello world", getline('.')) + " clean up set omnifunc= bw! - set complete& completeopt& + set complete& completeopt& autoindent& autocmd! AAAAA_Group augroup! AAAAA_Group delfunc OnPumChange diff --git a/src/version.c b/src/version.c index 02fc6a82f6..6d7077fe9d 100644 --- a/src/version.c +++ b/src/version.c @@ -729,6 +729,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 583, /**/ 582, /**/