mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-19 21:06:46 +00:00
fix(help): sort readme tags case sensitive. Fixes #67
This commit is contained in:
parent
4f27fc33c4
commit
54ecfc7c24
2 changed files with 6 additions and 2 deletions
|
@ -235,10 +235,14 @@ end
|
|||
---@generic V
|
||||
---@param t table<string, V>
|
||||
---@param fn fun(key:string, value:V)
|
||||
function M.foreach(t, fn)
|
||||
---@param opts? {case_sensitive?:boolean}
|
||||
function M.foreach(t, fn, opts)
|
||||
---@type string[]
|
||||
local keys = vim.tbl_keys(t)
|
||||
pcall(table.sort, keys, function(a, b)
|
||||
if opts and opts.case_sensitive then
|
||||
return a < b
|
||||
end
|
||||
return a:lower() < b:lower()
|
||||
end)
|
||||
for _, key in ipairs(keys) do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue