From 539eee18464130a84e0e4302711b39ed1971c96c Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Sat, 5 Nov 2022 22:38:21 +0800 Subject: [PATCH] fix(a.lua): fix alt function --- lua/spacevim/plugin/a.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lua/spacevim/plugin/a.lua b/lua/spacevim/plugin/a.lua index b771301e9..4d0147687 100644 --- a/lua/spacevim/plugin/a.lua +++ b/lua/spacevim/plugin/a.lua @@ -53,8 +53,11 @@ function M.set_config_name(path, name) end function M.alt(request_parse, ...) - local argv = {...} - local alt_type = argv[1] or 'alternate' + local argvs = ... + local alt_type = 'alternate' + if argvs ~= nil then + alt_type = argvs[1] or alt_type + end local alt = nil if fn.exists('b:alternate_file_config') ~= 1 then local conf_file_path = M.getConfigPath()