Fixed signify component apearing on non repo buffer (#58)
* Fixed signify component apearing on non repo buffer
This commit is contained in:
parent
2c1888e947
commit
8ff22c3935
|
@ -1,13 +1,11 @@
|
||||||
local function signify()
|
local function signify()
|
||||||
if vim.fn.exists('*sy#repo#get_stats') == 0 then return '' end
|
if vim.fn.exists('*sy#repo#get_stats') == 0 then return '' end
|
||||||
local added, modified, removed = unpack(vim.fn['sy#repo#get_stats']())
|
local added, modified, removed = unpack(vim.fn['sy#repo#get_stats']())
|
||||||
if added == -1 then added = 0 end
|
if added == -1 then return '' end
|
||||||
if modified == -1 then modified = 0 end
|
|
||||||
if removed == -1 then removed = 0 end
|
|
||||||
local data = {
|
local data = {
|
||||||
'+', added,
|
'+'..added,
|
||||||
'~', modified,
|
'-'..removed,
|
||||||
'-', removed
|
'~'..modified,
|
||||||
}
|
}
|
||||||
return table.concat(data, ' ')
|
return table.concat(data, ' ')
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue