Skip to content

Need rigorous testing for Pad's line parser function. #28

@dharmx

Description

@dharmx

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingenhancementNew feature or request

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions