Skip to content

Commit

Permalink
fix: only relayout with real width and height
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Oct 26, 2022
1 parent 906c6c8 commit 2462809
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lua/noice/view/nui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,13 @@ function NuiView:get_layout()
local layout = Util.nui.get_layout({ width = self:width(), height = self:height() }, self._opts)
if self._opts.type == "popup" then
---@cast layout _.NuiPopupOptions
if layout.size and layout.size.width < self:width() and self._opts.win_options and self._opts.win_options.wrap then
if
layout.size
and type(layout.size.width) == "number"
and layout.size.width < self:width()
and self._opts.win_options
and self._opts.win_options.wrap
then
local height = 0
for _, m in ipairs(self._messages) do
for _, l in ipairs(m._lines) do
Expand Down

0 comments on commit 2462809

Please sign in to comment.