0
0
mirror of https://github.com/vim/vim.git synced 2025-10-27 09:24:23 -04:00

patch 9.1.1305: completion menu active after switching windows/tabs

Problem:  When switching to another window or tab page while the
          completion menu is active, the menu stays visible, although it
          belongs to the previous window/tab page context (Evgeni
          Chasnovski).
Solution: Track the window and tab page where completion started. Detect
          changes in the main editing loop and cancel completion mode if
          the current window or tab page differs from where completion
          started.

fixes: #17090
closes: #17101

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
glepnir
2025-04-15 19:02:00 +02:00
committed by Christian Brabandt
parent babdb0554a
commit cf7f01252f
9 changed files with 139 additions and 10 deletions

View File

@@ -1411,6 +1411,11 @@ normalchar:
)
did_cursorhold = FALSE;
// Check if we need to cancel completion mode because the window
// or tab page was changed
if (ins_compl_active() && !ins_compl_win_active(curwin))
ins_compl_cancel();
// If the cursor was moved we didn't just insert a space
if (arrow_used)
inserted_space = FALSE;