* 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:
committed by
GitHub
parent
f742b86852
commit
a3aa3b47ea
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user