Skip to content

Commit

Permalink
fix: duplicate cursor moved event firing
Browse files Browse the repository at this point in the history
  • Loading branch information
Saghen committed Dec 21, 2024
1 parent 2325c78 commit e360828
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lua/blink/cmp/lib/buffer_events.lua
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,11 @@ function buffer_events:listen(opts)

vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI', 'InsertEnter' }, {
callback = function(ev)
-- only fire a CursorMoved event (notable not CursorMovedI) when jumping between tab stops in a snippet
-- and we're currently showing
-- only fire a CursorMoved event (notable not CursorMovedI)
-- when jumping between tab stops in a snippet while showing the menu
if
ev.event == 'CursorMoved'
and (vim.api.nvim_get_mode().mode ~= 'v' or not self.has_context())
and snippet.active()
and (vim.api.nvim_get_mode().mode ~= 'v' or not self.has_context() or not snippet.active())
then
return
end
Expand Down

0 comments on commit e360828

Please sign in to comment.