nvim-lualine / lualine.nvim

A blazing fast and easy to configure neovim statusline plugin written in pure lua.
MIT License
5.71k stars 455 forks source link

fix: prioritize user config for theme-loader on windows (#1213) #1214

Closed daephx closed 3 months ago

daephx commented 3 months ago

@shadmansaleh Man I even referenced the commit in my issue and didn't notice lualine_require just duplicates the same logic... Should I patch that one too? I've never used the custom require function so I idk in what circumstances it will have the same problem.

Edit2: At first I was uncertain but after some testing it seems this very well should be fixed, as it blocks the ability to load some user extensions.

https://github.com/nvim-lualine/lualine.nvim/blob/b5e8bb642138f787a2c1c5aedc2a78cb2cebbd67/lua/lualine_require.lua#L65-L67

Edit: I don't know if it even matters for this function. The code around it uses vim.api.nvim_get_runtime_file(pattern_path, false) and checks if the number of paths in the table is greater than 0. But the all=false parameter would only return the first match anyway. So either I'm misunderstanding the docs or it seems there's just never anything to sort! 😆

function vim.api.nvim_get_runtime_file(name: string, all: boolean) -> string[]
...
Parameters: ~
  • {name}  pattern of files to search for
  • {all}   whether to return all matches or only the first

https://github.com/nvim-lualine/lualine.nvim/blob/b5e8bb642138f787a2c1c5aedc2a78cb2cebbd67/lua/lualine_require.lua#L56-L73