- `searchcount.lua` now checks if the resulting table from `vim.fn.searchcount` is empty to avoid the error. Signed-off-by: Chris1320 <chris1320is@protonmail.com>
This commit is contained in:
parent
9170434aa1
commit
c28a7427c3
|
@ -20,6 +20,10 @@ function M:update_status()
|
||||||
end
|
end
|
||||||
|
|
||||||
local result = vim.fn.searchcount { maxcount = self.options.maxcount, timeout = self.options.timeout }
|
local result = vim.fn.searchcount { maxcount = self.options.maxcount, timeout = self.options.timeout }
|
||||||
|
if next(result) == nil then
|
||||||
|
return ''
|
||||||
|
end
|
||||||
|
|
||||||
local denominator = math.min(result.total, result.maxcount)
|
local denominator = math.min(result.total, result.maxcount)
|
||||||
return string.format('[%d/%d]', result.current, denominator)
|
return string.format('[%d/%d]', result.current, denominator)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue