Fix regression of commit characters

This commit is contained in:
hrsh7th
2021-08-05 15:21:36 +09:00
parent 56d22edbbf
commit cf61d0de50
3 changed files with 16 additions and 6 deletions

View File

@@ -15,7 +15,13 @@ local core = {}
core.SOURCE_TIMEOUT = 500
---@type cmp.Menu
core.menu = menu.new()
core.menu = menu.new({
on_select = function(e)
for _, c in ipairs(e:get_commit_characters()) do
keymap.listen(c, core.on_keymap)
end
end,
})
---@type table<number, cmp.Source>
core.sources = {}
@@ -114,7 +120,7 @@ core.prepare = function()
end
---Check auto-completion
core.autocomplete = function(event)
core.on_change = function(event)
local ctx = core.get_context({ reason = types.cmp.ContextReason.Auto })
-- Skip autocompletion when the item is selected manually.