if (!match_limit_exceeded && (!curbuf_only
|| cpt_sources_array[cur_source].cs_flag == '.'))
{
- if (first == NULL)
+ if (first == NULL && STRNCMP(ins_compl_leader(),
+ compl->cp_str.string, ins_compl_leader_len()) == 0)
{
first = compl->cp_str.string;
len = (int)STRLEN(first);
}
- else
+ else if (first != NULL)
{
int j = 0; // count in bytes
char_u *s1 = first;
vim_free(match_count);
- if (len > get_compl_len())
+ if (len > (int)ins_compl_leader_len())
{
*prefix_len = (size_t)len;
return first;
call DoTest("f", 'f', 2)
set cot-=fuzzy
+ " leader should match prefix of inserted word
+ %delete
+ set smartcase ignorecase
+ call setline(1, ["FOO"])
+ call feedkeys($"Gof\<F5>\<Esc>", 'tx')
+ call assert_equal('f', g:line)
+ call feedkeys($"SF\<F5>\<Esc>", 'tx')
+ call assert_equal('FOO', g:line)
+ set smartcase& ignorecase&
+
" Verify that redo (dot) works
+ %delete
call setline(1, ["foobar", "foozbar", "foobaz", "changed", "change"])
call feedkeys($"/foo\<CR>", 'tx')
call feedkeys($"cwch\<C-N>\<Esc>n.n.", 'tx')