feat(#1079): add renderer.highlight_clipboard default name, defaults to undercurls (#2410)

* feat(#1079): add highlight NvimTreeCopiedText and NvimTreeCutText

* feat(#1079): add highlight NvimTreeCopiedText and NvimTreeCutText

* feat(#1079): node may not be present in copy and cut

* feat(#1079): add renderer.highlight_clipboard

* feat(#1079): renderer.highlight_clipboard takes options, style cut/copy HL

* feat(#1079): renderer.highlight_clipboard takes options, style cut/copy HL

* feat(#1079): use an enum for highlight position

* feat(#1079): diagnostics uses _append_highlight
This commit is contained in:
Alexander Courtis
2023-09-17 16:08:04 +10:00
committed by GitHub
parent f742b86852
commit a3aa3b47ea
12 changed files with 205 additions and 91 deletions

View File

@@ -425,12 +425,18 @@ function M.array_shallow_clone(array)
return to
end
-- remove item from array if it exists
--- Remove and return item from array if present.
--- @param array table
--- @param item any
--- @return any|nil removed
function M.array_remove(array, item)
if not array then
return nil
end
for i, v in ipairs(array) do
if v == item then
table.remove(array, i)
break
return v
end
end
end