Handle InsertEnter and CmdlineEnter seperately
This commit is contained in:
@@ -277,6 +277,23 @@ autocmd.subscribe('InsertEnter', function()
|
||||
end)
|
||||
end)
|
||||
|
||||
autocmd.subscribe('InsertLeave', function()
|
||||
cmp.core:reset()
|
||||
cmp.core.view:close()
|
||||
end)
|
||||
|
||||
autocmd.subscribe('CmdlineEnter', function()
|
||||
if config.enabled() then
|
||||
cmp.core:prepare()
|
||||
cmp.core:on_change('InsertEnter')
|
||||
end
|
||||
end)
|
||||
|
||||
autocmd.subscribe('CmdlineLeave', function()
|
||||
cmp.core:reset()
|
||||
cmp.core.view:close()
|
||||
end)
|
||||
|
||||
autocmd.subscribe('TextChanged', function()
|
||||
if config.enabled() then
|
||||
cmp.core:on_change('TextChanged')
|
||||
@@ -289,11 +306,6 @@ autocmd.subscribe('CursorMoved', function()
|
||||
end
|
||||
end)
|
||||
|
||||
autocmd.subscribe('InsertLeave', function()
|
||||
cmp.core:reset()
|
||||
cmp.core.view:close()
|
||||
end)
|
||||
|
||||
cmp.event:on('confirm_done', function(e)
|
||||
cmp.config.compare.recently_used:add_entry(e)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user