mirror of
https://github.com/neovim/neovim.git
synced 2025-10-01 23:48:32 +00:00
vim-patch:9.1.1305: completion menu active after switching windows/tabs (#33488)
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: vim/vim#17090
closes: vim/vim#17101
cf7f01252f
Co-authored-by: glepnir <glephunter@gmail.com>
This commit is contained in:
@@ -381,6 +381,12 @@ static int insert_check(VimState *state)
|
||||
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) {
|
||||
s->inserted_space = false;
|
||||
|
Reference in New Issue
Block a user