1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 13:50:05 +08:00

fix(zettelkasten): use string.sub for long title

This commit is contained in:
Eric Wong 2024-12-22 23:05:15 +08:00
parent 71c3ac19e0
commit afe49af8a3

View File

@ -20,8 +20,9 @@ local s_formatters = {
['%h'] = function(line) ['%h'] = function(line)
if vim.fn.strdisplaywidth(line.title) <= 30 then if vim.fn.strdisplaywidth(line.title) <= 30 then
return line.title .. string.rep(' ', 30 - vim.fn.strdisplaywidth(line.title)) return line.title .. string.rep(' ', 30 - vim.fn.strdisplaywidth(line.title))
else
return string.sub(line.title, 1, 27) .. '...'
end end
return line.title
end, end,
['%d'] = function(line) ['%d'] = function(line)
return line.id return line.id