From 4c3f697ab5af83743ca3772dda771f12ae350050 Mon Sep 17 00:00:00 2001 From: CogentRedTester Date: Mon, 3 Feb 2025 17:35:12 +1030 Subject: [PATCH] controls.lua: add type annotations for functions --- modules/controls.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/controls.lua b/modules/controls.lua index fcfe790..1bfe5ce 100644 --- a/modules/controls.lua +++ b/modules/controls.lua @@ -70,12 +70,15 @@ function controls.escape() controls.close() end ---opens a specific directory +---opens a specific directory +---@param directory string +---@param open_browser? boolean +---@return thread|nil function controls.browse_directory(directory, open_browser) if not directory then return end if open_browser == nil then open_browser = true end - directory = mp.command_native({"expand-path", directory}) or '' + directory = mp.command_native({"expand-path", directory}, '') --[[@as string]] -- directory = join_path( mp.get_property("working-directory", ""), directory ) if directory ~= "" then directory = fb_utils.fix_path(directory, true) end