Let me know if anyone finds any bugs while using this.
Note that, it is likely that you won't find any bugs if you have disabled devicons. The problem starts only when you use those. IT IS THE BANE OF MY EXISTENCE.
|
function Pad.line2mark(line, icons, disable_devicons) |
|
local trimmed = vim.trim(line) |
|
if trimmed ~= "" then |
|
local mark |
|
if disable_devicons then |
|
mark = Mark({ uri = trimmed }) |
|
else |
|
local icon, content = line:match("^([^%s]+)%s(.+)$") |
|
if icon and not utils.is_uri(icon) then |
|
mark = Mark({ uri = content }) |
|
if |
|
not util.icon_exists(icon, icons) |
|
and util.get_icon(mark, icons, { disable_devicons = disable_devicons }) ~= icon |
|
then |
|
mark.uri = trimmed |
|
end |
|
else |
|
mark = Mark({ uri = trimmed }) |
|
end |
|
end |
|
return mark |
|
end |
|
end |
Let me know if anyone finds any bugs while using this.
Note that, it is likely that you won't find any bugs if you have disabled devicons. The problem starts only when you use those. IT IS THE BANE OF MY EXISTENCE.
track.nvim/lua/track/pad.lua
Lines 109 to 131 in b79584a