summaryrefslogtreecommitdiff
path: root/xmake/modules/private/utils/complete.lua
diff options
context:
space:
mode:
authorOpportunity <[email protected]>2020-01-20 20:30:31 +0800
committerOpportunity <[email protected]>2020-01-20 22:21:47 +0800
commit3364333877dc8a579f08b54099fda653948e07ab (patch)
tree2c2d5b6dabd5937827f9ae0cbc511b8a2f16f5d4 /xmake/modules/private/utils/complete.lua
parent5f96933d1ad672cc5b29df88a78b32ff4cdd3ebc (diff)
improve tab complete
Diffstat (limited to 'xmake/modules/private/utils/complete.lua')
-rw-r--r--xmake/modules/private/utils/complete.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/xmake/modules/private/utils/complete.lua b/xmake/modules/private/utils/complete.lua
index 71c7e9fa3..16594088f 100644
--- a/xmake/modules/private/utils/complete.lua
+++ b/xmake/modules/private/utils/complete.lua
@@ -98,7 +98,7 @@ function _complete_option_kv(options, current, completing)
-- show candidates of values
local values = opt.values
if type(values) == "function" then
- values = values(value)
+ values = values(value, current)
end
if values == nil and type(opt[4]) == "boolean" then
values = { "y", "n" }
@@ -158,7 +158,7 @@ function _complete_option_v(options, current, completing)
-- show candidates of values
local values = opt.values
if type(values) == "function" then
- values = values(completing)
+ values = values(completing, current)
end
for _, v in ipairs(values) do
if tostring(v):startswith(completing) then