static void
ins_compl_delete(void)
{
- int i;
+ int col;
/*
* In insert mode: Delete the typed part.
* In replace mode: Put the old characters back, if any.
*/
- i = compl_col + (compl_cont_status & CONT_ADDING ? compl_length : 0);
- backspace_until_column(i);
+ col = compl_col + (compl_cont_status & CONT_ADDING ? compl_length : 0);
+ if ((int)curwin->w_cursor.col > col)
+ {
+ if (stop_arrow() == FAIL)
+ return;
+ backspace_until_column(col);
+ }
/* TODO: is this sufficient for redrawing? Redrawing everything causes
* flicker, thus we can't do that. */
colnr_T curs_col; /* cursor column */
int n;
int save_w_wrow;
+ int insert_match;
compl_direction = ins_compl_key2dir(c);
+ insert_match = ins_compl_use_match(c);
+
if (!compl_started)
{
/* First time we hit ^N or ^P (in a row, I mean) */
edit_submode_extra = NULL;
out_flush();
}
+ else if (insert_match && stop_arrow() == FAIL)
+ return FAIL;
compl_shown_match = compl_curr_match;
compl_shows_dir = compl_direction;
* Find next match (and following matches).
*/
save_w_wrow = curwin->w_wrow;
- n = ins_compl_next(TRUE, ins_compl_key2count(c),
- ins_compl_use_match(c), FALSE);
+ n = ins_compl_next(TRUE, ins_compl_key2count(c), insert_match, FALSE);
/* may undisplay the popup menu */
ins_compl_upd_pum();
call feedkeys("u", 'xt')
call assert_equal('bbb', getline(2))
+ call feedkeys("A\<Right>\<C-N>\<Esc>", 'xt')
+ call assert_equal('January', getline(2))
+ call feedkeys("u", 'xt')
+ call assert_equal('bbb', getline(2))
+
iunmap <Right>
set completeopt&
q!