diff options
| author | Bram Moolenaar <Bram@vim.org> | 2016-10-16 15:35:47 +0200 |
|---|---|---|
| committer | Bram Moolenaar <Bram@vim.org> | 2016-10-16 15:35:47 +0200 |
| commit | 869e35270ecffd9024958880cb03f6f0bb01ea93 (patch) | |
| tree | da022669c9ecf5145ffce0963fa53984fda22c17 /src/edit.c | |
| parent | 8507747600bddfd6a68aed057840856bf5548e61 (diff) | |
| download | vim-git-869e35270ecffd9024958880cb03f6f0bb01ea93.tar.gz | |
patch 8.0.0041v8.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/edit.c')
| -rw-r--r-- | src/edit.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/edit.c b/src/edit.c index d763b5318..53b43c485 100644 --- a/src/edit.c +++ b/src/edit.c @@ -2799,9 +2799,6 @@ set_completion(colnr_T startcol, list_T *list) ins_compl_prep(' '); ins_compl_clear(); - if (stop_arrow() == FAIL) - return; - compl_direction = FORWARD; if (startcol > curwin->w_cursor.col) startcol = curwin->w_cursor.col; @@ -3876,7 +3873,8 @@ ins_compl_prep(int c) /* put the cursor on the last char, for 'tw' formatting */ if (prev_col > 0) dec_cursor(); - if (stop_arrow() == OK) + /* only format when something was inserted */ + if (!arrow_used && !ins_need_undo) insertchar(NUL, 0, -1); if (prev_col > 0 && ml_get_curline()[curwin->w_cursor.col] != NUL) |
