ins_compl_insert_bytes(compl_leader.string + get_compl_len(), -1);
compl_used_match = FALSE;
- if (p_acl > 0)
- {
- update_screen(UPD_VALID); // Show char (deletion) immediately
- out_flush();
- }
-
if (compl_started)
{
ins_compl_set_original_text(compl_leader.string, compl_leader.length);
int compl_no_insert = (cur_cot_flags & COT_NOINSERT) != 0
|| (compl_autocomplete && !ins_compl_has_preinsert());
int compl_preinsert = ins_compl_has_preinsert();
- int has_autocomplete_delay = (compl_autocomplete && p_acl > 0);
// When user complete function return -1 for findstart which is next
// time of 'always', compl_shown_match become NULL.
// Insert the text of the new completion, or the compl_leader.
if (!started && ins_compl_preinsert_longest())
- {
ins_compl_insert(TRUE, TRUE);
- if (has_autocomplete_delay)
- update_screen(0); // Show the inserted text right away
- }
else if (compl_no_insert && !started && !compl_preinsert)
{
ins_compl_insert_bytes(compl_orig_text.string + get_compl_len(), -1);
// may undisplay the popup menu first
ins_compl_upd_pum();
- if (pum_enough_matches() && !has_autocomplete_delay)
+ if (pum_enough_matches())
// Will display the popup menu, don't redraw yet to avoid flicker.
pum_call_update_screen();
else
// inserted.
update_screen(0);
- if (!has_autocomplete_delay)
- {
- // display the updated popup menu
- ins_compl_show_pum();
+ // display the updated popup menu
+ ins_compl_show_pum();
#ifdef FEAT_GUI
- if (gui.in_use)
- {
- // Show the cursor after the match, not after the redrawn text.
- setcursor();
- out_flush_cursor(FALSE, FALSE);
- }
-#endif
+ if (gui.in_use)
+ {
+ // Show the cursor after the match, not after the redrawn text.
+ setcursor();
+ out_flush_cursor(FALSE, FALSE);
}
+#endif
// Delete old text to be replaced, since we're still searching and
// don't want to match ourselves!
call term_sendkeys(buf, "\<BS>")
call VerifyScreenDump(buf, 'Test_autocompletedelay_5', {})
sleep 500m
- call VerifyScreenDump(buf, 'Test_autocompletedelay_6', {})
+ call VerifyScreenDump(buf, 'Test_autocompletedelay_5', {})
" During delay wait, user can open menu using CTRL_N completion
call term_sendkeys(buf, "\<Esc>:set completeopt=menuone\<CR>")
" Preinsert
call term_sendkeys(buf, "\<Esc>:set completeopt& completeopt+=preinsert\<CR>")
-
- " Show preinserted text right away but display popup later
call term_sendkeys(buf, "\<Esc>Sau")
sleep 100m
call VerifyScreenDump(buf, 'Test_autocompletedelay_preinsert_1', {})