Skip to content

Commit

Permalink
fix(#1087): handle searchcount failures (#1088)
Browse files Browse the repository at this point in the history
Co-authored-by: Shadman <[email protected]>
  • Loading branch information
alex-courtis and shadmansaleh authored Oct 20, 2023
1 parent 1dc8b44 commit 2248ef2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/lualine/components/searchcount.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ function M:update_status()
return ''
end

local result = vim.fn.searchcount { maxcount = self.options.maxcount, timeout = self.options.timeout }
if next(result) == nil then
local ok, result = pcall(vim.fn.searchcount, { maxcount = self.options.maxcount, timeout = self.options.timeout })
if not ok or next(result) == nil then
return ''
end

Expand Down

0 comments on commit 2248ef2

Please sign in to comment.