Add complete_done event and improved the recently_used sorter.

Fix #708
This commit is contained in:
hrsh7th
2022-01-08 13:38:55 +09:00
parent a4f83fd839
commit 3f7b7b258a
4 changed files with 21 additions and 4 deletions

View File

@@ -308,8 +308,16 @@ autocmd.subscribe('CursorMoved', function()
end
end)
cmp.event:on('confirm_done', function(e)
cmp.config.compare.recently_used:add_entry(e)
cmp.event:on('complete_done', function(evt)
if evt.entry then
cmp.config.compare.recently_used:add_entry(evt.entry)
end
end)
cmp.event:on('confirm_done', function(evt)
if evt.entry then
cmp.config.compare.recently_used:add_entry(evt.entry)
end
end)
return cmp