Skip to content

Commit

Permalink
controls.lua: add type annotations for functions
Browse files Browse the repository at this point in the history
  • Loading branch information
CogentRedTester committed Feb 3, 2025
1 parent 7013ccd commit 4c3f697
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions modules/controls.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4c3f697

Please sign in to comment.