From b5e8bb642138f787a2c1c5aedc2a78cb2cebbd67 Mon Sep 17 00:00:00 2001 From: Daemon Date: Wed, 20 Mar 2024 22:18:13 -0700 Subject: [PATCH] fix: prioritize user config for theme-loader on windows (#1213) (#1214) --- lua/lualine/utils/loader.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/lualine/utils/loader.lua b/lua/lualine/utils/loader.lua index 37baa015d..e0c0385e3 100644 --- a/lua/lualine/utils/loader.lua +++ b/lua/lualine/utils/loader.lua @@ -229,7 +229,8 @@ local function load_theme(theme_name) -- put entries from user config path in front local user_config_path = vim.fn.stdpath('config') table.sort(files, function(a, b) - return vim.startswith(a, user_config_path) or not vim.startswith(b, user_config_path) + local pattern = table.concat { user_config_path, sep } + return string.match(a, pattern) or not string.match(b, pattern) end) -- More then 1 found . Use the first one that isn't in lualines repo local lualine_repo_pattern = table.concat({ 'lualine.nvim', 'lua', 'lualine' }, sep)