Fix error when user command calls nav

This commit is contained in:
Shi Han NG committed 2024-07-13 16:08:20 +09:00
1 parent 2bc42accec
commit e11d413ed2
1 file changed
+5 -1
+5 -1
View File
@@ -1,7 +1,11 @@
local M = {} local M = {}
local function nav(short_direction, direction, action) local function nav(short_direction, direction, action)
action = action or "move-focus" -- Use "move-focus" if nav is called via user command or
-- action is nil.
if type(action) == "table" or not action then
action = "move-focus"
end
if action ~= "move-focus" and action ~= "move-focus-or-tab" then if action ~= "move-focus" and action ~= "move-focus-or-tab" then
error("invalid action: " .. action) error("invalid action: " .. action)