Skip to content

Commit ccf39b6

Browse files
committed
fix(loader): look for themes on package.path
1 parent b431d22 commit ccf39b6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lua/lualine/utils/loader.lua

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,12 @@ local function load_theme(theme_name)
220220
end
221221
local n_files = #files
222222
if n_files == 0 then
223-
-- No match found
224-
error(path .. ' Not found')
223+
-- No match found on runtimepath. Fall back to package.path
224+
local file = assert(
225+
package.searchpath('lualine.themes.' .. theme_name, package.path),
226+
'Theme ' .. theme_name .. ' not found'
227+
)
228+
retval = dofile(file)
225229
elseif n_files == 1 then
226230
-- when only one is found run that and return it's return value
227231
retval = dofile(files[1])

0 commit comments

Comments
 (0)