root.lua (530B)
1 -- This file is an internal file-browser addon. 2 -- It should not be imported like a normal module. 3 4 local g = require 'modules.globals' 5 6 ---Parser for the root. 7 ---@type ParserConfig 8 local root_parser = { 9 name = "root", 10 priority = math.huge, 11 api_version = '1.0.0', 12 } 13 14 function root_parser:can_parse(directory) 15 return directory == '' 16 end 17 18 --we return the root directory exactly as setup 19 function root_parser:parse() 20 return g.root, { 21 sorted = true, 22 filtered = true, 23 } 24 end 25 26 return root_parser