@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.
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
@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 theall=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! 😆https://github.com/nvim-lualine/lualine.nvim/blob/b5e8bb642138f787a2c1c5aedc2a78cb2cebbd67/lua/lualine_require.lua#L56-L73