diff options
author | Tommy Allen <tommy@esdf.io> | 2016-10-17 17:16:56 -0400 |
---|---|---|
committer | Tommy Allen <tommy@esdf.io> | 2016-10-22 15:15:21 -0400 |
commit | c377c8be6185f0773163c915d3caf0862bc26f53 (patch) | |
tree | e34ec3780ca7fe40849850d8a7c42fe71378c4f3 /src/nvim/edit.c | |
parent | 31df051ed9a3f8cc9ad7a4e408e3ba03a1c5272b (diff) | |
download | rneovim-c377c8be6185f0773163c915d3caf0862bc26f53.tar.gz rneovim-c377c8be6185f0773163c915d3caf0862bc26f53.tar.bz2 rneovim-c377c8be6185f0773163c915d3caf0862bc26f53.zip |
vim-patch:8.0.0041
Problem: When using Insert mode completion but not actually inserting
anything an undo item is still created. (Tommy Allen)
Solution: Do not call stop_arrow() when not inserting anything.
Diffstat (limited to 'src/nvim/edit.c')
-rw-r--r-- | src/nvim/edit.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c index a0ae1a3e6b..f4623615b9 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -2350,9 +2350,6 @@ void set_completion(colnr_T startcol, list_T *list) } ins_compl_clear(); - if (stop_arrow() == FAIL) - return; - compl_direction = FORWARD; if (startcol > curwin->w_cursor.col) startcol = curwin->w_cursor.col; @@ -3263,14 +3260,19 @@ static bool ins_compl_prep(int c) } else { int prev_col = curwin->w_cursor.col; - /* put the cursor on the last char, for 'tw' formatting */ - if (prev_col > 0) + // put the cursor on the last char, for 'tw' formatting + if (prev_col > 0) { dec_cursor(); - if (stop_arrow() == OK) + } + + if (!arrow_used && !ins_need_undo) { insertchar(NUL, 0, -1); + } + if (prev_col > 0 - && get_cursor_line_ptr()[curwin->w_cursor.col] != NUL) + && get_cursor_line_ptr()[curwin->w_cursor.col] != NUL) { inc_cursor(); + } } // If the popup menu is displayed pressing CTRL-Y means accepting |