aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorglepnir <glephunter@gmail.com>2025-03-15 17:40:25 +0800
committerGitHub <noreply@github.com>2025-03-15 09:40:25 +0000
commit551e26963be8de5cac97d915c799a25f7bd77648 (patch)
tree367389cd962276e5930852cbd2117091a1193c14 /src
parentec8fc2874344c7e25f8cbb6894cde526164ea756 (diff)
downloadrneovim-551e26963be8de5cac97d915c799a25f7bd77648.tar.gz
rneovim-551e26963be8de5cac97d915c799a25f7bd77648.tar.bz2
rneovim-551e26963be8de5cac97d915c799a25f7bd77648.zip
vim-patch:9.1.1205: completion: preinserted text not removed when closing pum (#32903)
Problem: completion: preinserted text not removed when closing pum Solution: delete preinsert text inside in ins_compl_stop() (glepnir). closes: vim/vim#16891 https://github.com/vim/vim/commit/84a7503e29dc248661efc98b6c59d2e911452d5c
Diffstat (limited to 'src')
-rw-r--r--src/nvim/insexpand.c4
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.