fix(nvim): properly check searchcount in heirline

This commit is contained in:
Price Hiller 2023-09-30 11:12:21 -05:00
parent 1176858f95
commit db6575d2d1
Signed by: Price
SSH Key Fingerprint: SHA256:Y4S9ZzYphRn1W1kbJerJFO6GGsfu9O70VaBSxJO7dF8

View File

@ -156,7 +156,7 @@ return {
["sshconfig"] = { icon = "󰴳", icon_color = colors.carpYellow },
["sshdconfig"] = "sshconfig",
["help"] = { icon = "󰋗", icon_color = colors.springGreen },
["octo"] = { icon = "", icon_color = colors.fujiWhite }
["octo"] = { icon = "", icon_color = colors.fujiWhite },
}
local buftype_overrides = {
@ -541,8 +541,8 @@ return {
{
FileNameBlock,
static = {
bg_color_right = nil
}
bg_color_right = nil,
},
},
margin(1),
{
@ -776,7 +776,7 @@ return {
VimMode,
{
condition = function()
return vim.v.hlsearch ~= 0
return #vim.fn.searchcount() ~= 0
end,
{
provider = " " .. seps.full.left,
@ -809,7 +809,15 @@ return {
end,
provider = function(self)
local search = self.search
return string.format(" %d/%d", search.current, math.min(search.total, search.maxcount))
if search == nil then
return " ?/?"
else
return string.format(
" %d/%d",
search.current,
math.min(search.total, search.maxcount)
)
end
end,
hl = {
fg = colors.fujiWhite,
@ -890,14 +898,14 @@ return {
{
{
provider = seps.full.left,
hl = { fg = colors.sumiInk4, bg = utils.get_highlight("StatusLine").bg }
hl = { fg = colors.sumiInk4, bg = utils.get_highlight("StatusLine").bg },
},
{
FileNameBlock,
static = {
bg_color_right = utils.get_highlight("StatusLine").bg
}
}
bg_color_right = utils.get_highlight("StatusLine").bg,
},
},
},
margin(1),
{