mirror of
https://github.com/folke/snacks.nvim
synced 2025-12-23 08:47:57 +00:00
fix(picker): only trim space in the title if it's preceded by a word like character (skips icons)
This commit is contained in:
parent
a249c86cf1
commit
2439c493a5
1 changed files with 1 additions and 1 deletions
|
|
@ -421,7 +421,7 @@ function M:update_titles()
|
|||
text = text:gsub("{flags}", "")
|
||||
has_flags = true
|
||||
end
|
||||
text = vim.trim(Snacks.picker.util.tpl(text, data)):gsub("%s+", " ")
|
||||
text = vim.trim(Snacks.picker.util.tpl(text, data)):gsub("([%w%p])%s+", "%1 ")
|
||||
if text ~= "" then
|
||||
-- HACK: add extra space when last char is non word like an icon
|
||||
text = text:sub(-1):match("[%w%p]") and text or text .. " "
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue