Add cmp.EventConfig
This commit is contained in:
@@ -48,6 +48,8 @@ return function()
|
||||
}
|
||||
},
|
||||
|
||||
event = {},
|
||||
|
||||
mapping = {},
|
||||
|
||||
formatting = {
|
||||
|
||||
@@ -254,6 +254,9 @@ core.confirm = vim.schedule_wrap(function(e, option, callback)
|
||||
})
|
||||
end
|
||||
e:execute(function()
|
||||
if config.get().event.on_confirm_done then
|
||||
config.get().event.on_confirm_done(e)
|
||||
end
|
||||
if callback then
|
||||
callback()
|
||||
end
|
||||
|
||||
@@ -51,6 +51,7 @@ cmp.ScrollDirection.Down = 'down'
|
||||
---@field public sorting cmp.SortingConfig
|
||||
---@field public formatting cmp.FormattingConfig
|
||||
---@field public snippet cmp.SnippetConfig
|
||||
---@field public event cmp.EventConfig
|
||||
---@field public mapping table<string, fun(core: cmp.Core, fallback: function)>
|
||||
---@field public sources cmp.SourceConfig[]
|
||||
|
||||
@@ -79,6 +80,9 @@ cmp.ScrollDirection.Down = 'down'
|
||||
---@class cmp.SnippetConfig
|
||||
---@field public expand fun(args: cmp.SnippetExpansionParams)
|
||||
|
||||
---@class cmp.EventConfig
|
||||
---@field on_confirm_done function(e: cmp.Entry)
|
||||
|
||||
---@class cmp.SourceConfig
|
||||
---@field public name string
|
||||
---@field public opts table
|
||||
|
||||
Reference in New Issue
Block a user