Skip to content

Commit

Permalink
[fix]: when window switch too quickly, make incorrect lightulb request
Browse files Browse the repository at this point in the history
  • Loading branch information
jinzhongjia committed Feb 7, 2024
1 parent 29d540a commit cefdb7d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lua/LspUI/lightbulb/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ M.request = function(buffer_id, callback)
if not api.nvim_buf_is_valid(buffer_id) then
return
end
-- when switch buffer too quickly, window will be not correct
-- maybe this problem is caused by neovim event loop
if buffer_id ~= api.nvim_win_get_buf(api.nvim_get_current_win()) then
return
end
local params = lsp.util.make_range_params()
local context = {
triggerKind = vim.lsp.protocol.CodeActionTriggerKind.Invoked,
Expand Down

0 comments on commit cefdb7d

Please sign in to comment.