Skip to content

Commit

Permalink
fix: check for nil on zindex. Fixes #129
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Oct 26, 2022
1 parent d2064a5 commit 07465b3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lua/noice/view/scrollbar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,14 @@ function Scrollbar:update()
self:show()
end

local zindex = vim.api.nvim_win_get_config(self.winnr).zindex or 50

Util.win_apply_config(self.bar.winnr, {
height = dim.height,
width = 1,
col = dim.col + dim.width - 1,
row = dim.row,
zindex = vim.api.nvim_win_get_config(self.winnr).zindex + 10,
zindex = zindex + 10,
})

local thumb_height = math.floor(dim.height * dim.height / buf_height + 0.5)
Expand All @@ -124,7 +126,7 @@ function Scrollbar:update()
height = thumb_height,
row = dim.row + thumb_offset,
col = dim.col + dim.width - 1, -- info.col was already added scrollbar offset.
zindex = vim.api.nvim_win_get_config(self.winnr).zindex + 20,
zindex = zindex + 20,
})
end

Expand Down

0 comments on commit 07465b3

Please sign in to comment.