mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 18:58:12 +00:00
fix(picker): format: one too many spaces for default icon in results … (#594)
The default icon returned from Snacks utils already has a space for padding. The fix is to only append a space if there's none.  Co-authored-by: biggybi <biggybi@pm.me>
This commit is contained in:
parent
47ea3280e8
commit
d7f727f673
1 changed files with 2 additions and 1 deletions
|
@ -37,7 +37,8 @@ function M.filename(item, picker)
|
|||
|
||||
if picker.opts.icons.files.enabled ~= false then
|
||||
local icon, hl = Snacks.util.icon(name, cat)
|
||||
ret[#ret + 1] = { icon .. " ", hl, virtual = true }
|
||||
local padded_icon = icon:sub(-1) == " " and icon or icon .. " "
|
||||
ret[#ret + 1] = { padded_icon, hl, virtual = true }
|
||||
end
|
||||
|
||||
local dir, file = path:match("^(.*)/(.+)$")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue