feat: add highlight group for orphaned links (#502)
* feat: add highlight for orphan links Closes #501 * feat: add OilOrphanLinkTarget highlight group --------- Co-authored-by: Steven Arcangeli <stevearc@stevearc.com>
This commit is contained in:
parent
5fa528f552
commit
740b8fd425
3 changed files with 19 additions and 2 deletions
|
|
@ -816,11 +816,21 @@ M._get_highlights = function()
|
|||
link = nil,
|
||||
desc = "Soft links in an oil buffer",
|
||||
},
|
||||
{
|
||||
name = "OilOrphanLink",
|
||||
link = nil,
|
||||
desc = "Orphaned soft links in an oil buffer",
|
||||
},
|
||||
{
|
||||
name = "OilLinkTarget",
|
||||
link = "Comment",
|
||||
desc = "The target of a soft link",
|
||||
},
|
||||
{
|
||||
name = "OilOrphanLinkTarget",
|
||||
link = "DiagnosticError",
|
||||
desc = "The target of an orphaned soft link",
|
||||
},
|
||||
{
|
||||
name = "OilFile",
|
||||
link = nil,
|
||||
|
|
|
|||
|
|
@ -728,10 +728,11 @@ M.format_entry_cols = function(entry, column_defs, col_width, adapter)
|
|||
end
|
||||
end
|
||||
end
|
||||
local is_orphan = not (meta and meta.link_stat)
|
||||
|
||||
table.insert(cols, { name, "OilLink" })
|
||||
table.insert(cols, { name, is_orphan and "OilOrphanLink" or "OilLink" })
|
||||
if link_text then
|
||||
table.insert(cols, { link_text, "OilLinkTarget" })
|
||||
table.insert(cols, { link_text, is_orphan and "OilOrphanLinkTarget" or "OilLinkTarget" })
|
||||
end
|
||||
else
|
||||
table.insert(cols, { name, "OilFile" })
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue