From 157390d2c15ea21addcbece29b8e705fb2042527 Mon Sep 17 00:00:00 2001 From: hrsh7th Date: Fri, 3 Sep 2021 20:40:19 +0900 Subject: [PATCH] Invoke redraw if pum is beeing visible --- lua/cmp/core.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lua/cmp/core.lua b/lua/cmp/core.lua index 7c19992..4365335 100644 --- a/lua/cmp/core.lua +++ b/lua/cmp/core.lua @@ -266,7 +266,15 @@ core.filter = async.throttle(function() end end + local prev = core.menu:get_first_entry() core.menu:update(ctx, core.get_sources()) + local next = core.menu:get_first_entry() + + local prev_word = prev and prev:get_word() + local next_word = next and next:get_word() + if prev_word ~= next_word then + vim.cmd [[redraw!]] + end end, 50) ---Confirm completion.