Skip to content

Commit

Permalink
fix(loader): look for themes on package.path (#1300)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjkb authored Nov 1, 2024
1 parent 0652d2a commit 6f2def5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lua/lualine/utils/loader.lua
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,12 @@ local function load_theme(theme_name)
end
local n_files = #files
if n_files == 0 then
-- No match found
error(path .. ' Not found')
-- No match found on runtimepath. Fall back to package.path
local file = assert(
package.searchpath('lualine.themes.' .. theme_name, package.path),
'Theme ' .. theme_name .. ' not found'
)
retval = dofile(file)
elseif n_files == 1 then
-- when only one is found run that and return it's return value
retval = dofile(files[1])
Expand Down

0 comments on commit 6f2def5

Please sign in to comment.