mirror of
https://github.com/neovim/neovim.git
synced 2025-11-15 14:59:20 +00:00
fix(lsp): ignore inline completions after leaving insert mode (#36476)
**Problem:** When quickly entering and leaving insert mode, sometimes inline completion requests are returned and handled in normal mode. This causes an extmark to be set, which will not get cleared until the next time entering & leaving insert mode. **Solution:** Return early in the inline completion handler if we have left insert mode.
This commit is contained in:
@@ -121,7 +121,7 @@ function Completor:handler(err, result, ctx)
|
|||||||
log.error('inlinecompletion', err)
|
log.error('inlinecompletion', err)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if not result then
|
if not result or not vim.startswith(api.nvim_get_mode().mode, 'i') then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user