Skip to content

Commit af90f8f

Browse files
troigantotroiganto
and
troiganto
authored
fix(ui): allow built-in completions in orgmode.ui.input (#903)
Co-authored-by: troiganto <[email protected]>
1 parent b6bd999 commit af90f8f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lua/orgmode/ui/input.lua

+4-2
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,17 @@ local OrgInput = {}
77

88
---@param prompt string
99
---@param default? string
10-
---@param completion? fun(arg_lead: string): string[]
10+
---@param completion? string | fun(arg_lead: string): string[]
1111
---@return OrgPromise<string>
1212
function OrgInput.open(prompt, default, completion)
1313
_G.orgmode.__input_completion = completion
1414
local opts = {
1515
prompt = prompt,
1616
default = default or '',
1717
}
18-
if completion then
18+
if type(completion) == 'string' then
19+
opts.completion = completion
20+
elseif completion then
1921
opts.completion = 'customlist,v:lua.orgmode.__input_completion'
2022
end
2123

0 commit comments

Comments
 (0)