feat(picker): added new icons picker for nerd fonts and emoji. Closes #703

This commit is contained in:
Folke Lemaitre 2025-01-23 10:51:17 +01:00
parent 570d2191d5
commit 97898e910d
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
6 changed files with 138 additions and 2 deletions

View file

@ -514,4 +514,19 @@ function M.debug(item, picker)
return ret
end
function M.icon(item, picker)
local a = Snacks.picker.util.align
---@cast item snacks.picker.Icon
local ret = {} ---@type snacks.picker.Highlight[]
ret[#ret + 1] = { a(item.icon, 2), "SnacksPickerIcon" }
ret[#ret + 1] = { " " }
ret[#ret + 1] = { a(item.source, 10), "SnacksPickerIconSource" }
ret[#ret + 1] = { " " }
ret[#ret + 1] = { a(item.name, 30), "SnacksPickerIconName" }
ret[#ret + 1] = { " " }
ret[#ret + 1] = { a(item.category, 8), "SnacksPickerIconCategory" }
return ret
end
return M