Skip to content
This repository has been archived by the owner on Feb 20, 2025. It is now read-only.

Commit

Permalink
fix(zettelkasten): use string.sub for long title
Browse files Browse the repository at this point in the history
  • Loading branch information
wsdjeg committed Dec 22, 2024
1 parent 71c3ac1 commit afe49af
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bundle/vim-zettelkasten/lua/zettelkasten/formatter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ local s_formatters = {
['%h'] = function(line)
if vim.fn.strdisplaywidth(line.title) <= 30 then
return line.title .. string.rep(' ', 30 - vim.fn.strdisplaywidth(line.title))
else
return string.sub(line.title, 1, 27) .. '...'
end
return line.title
end,
['%d'] = function(line)
return line.id
Expand Down

0 comments on commit afe49af

Please sign in to comment.