diff --git a/lua/lualine/utils/loader.lua b/lua/lualine/utils/loader.lua index e0c0385e3..0f2d371d6 100644 --- a/lua/lualine/utils/loader.lua +++ b/lua/lualine/utils/loader.lua @@ -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])