diff options
Diffstat (limited to 'src/nvim/insexpand.c')
-rw-r--r-- | src/nvim/insexpand.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nvim/insexpand.c b/src/nvim/insexpand.c index d02a698f08..1be4f601bc 100644 --- a/src/nvim/insexpand.c +++ b/src/nvim/insexpand.c @@ -2169,6 +2169,10 @@ static bool set_ctrl_x_mode(const int c) /// Stop insert completion mode static bool ins_compl_stop(const int c, const int prev_mode, bool retval) { + // Remove pre-inserted text when present. + if (ins_compl_preinsert_effect()) { + ins_compl_delete(false); + } // Get here when we have finished typing a sequence of ^N and // ^P or other completion characters in CTRL-X mode. Free up // memory that was used, and make sure we can redo the insert. |