Fix #615
Fix #798
This commit is contained in:
hrsh7th
2022-02-15 20:20:57 +09:00
parent ba47440a97
commit 4f5cc6a9c8
3 changed files with 77 additions and 3 deletions

View File

@@ -29,6 +29,28 @@ misc.concat = function(list1, list2)
return new_list
end
---Return the valu is empty or not.
---@param v any
---@return boolean
misc.empty = function(v)
if not v then
return true
end
if v == vim.NIL then
return true
end
if type(v) == 'string' and v == '' then
return true
end
if type(v) == 'table' and vim.tbl_isempty(v) then
return true
end
if type(v) == 'number' and v == 0 then
return true
end
return false
end
---The symbol to remove key in misc.merge.
misc.none = vim.NIL