Fix #1322
This commit is contained in:
@@ -304,7 +304,8 @@ local on_insert_enter = function()
|
|||||||
cmp.core:on_change('InsertEnter')
|
cmp.core:on_change('InsertEnter')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
autocmd.subscribe({ 'InsertEnter', 'CmdlineEnter' }, async.debounce_next_tick(on_insert_enter))
|
autocmd.subscribe({ 'CmdlineEnter' }, async.debounce_next_tick(on_insert_enter))
|
||||||
|
autocmd.subscribe({ 'InsertEnter' }, async.debounce_next_tick_by_keymap(on_insert_enter))
|
||||||
|
|
||||||
-- async.throttle is needed for performance. The mapping `:<C-u>...<CR>` will fire `CmdlineChanged` for each character.
|
-- async.throttle is needed for performance. The mapping `:<C-u>...<CR>` will fire `CmdlineChanged` for each character.
|
||||||
local on_text_changed = function()
|
local on_text_changed = function()
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
local feedkeys = require('cmp.utils.feedkeys')
|
||||||
|
|
||||||
local async = {}
|
local async = {}
|
||||||
|
|
||||||
---@class cmp.AsyncThrottle
|
---@class cmp.AsyncThrottle
|
||||||
@@ -138,4 +140,11 @@ async.debounce_next_tick = function(callback)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---Wait and callback for consuming next keymap.
|
||||||
|
async.debounce_next_tick_by_keymap = function(callback)
|
||||||
|
return function()
|
||||||
|
feedkeys.call('', '', callback)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
return async
|
return async
|
||||||
|
|||||||
Reference in New Issue
Block a user