Opts.wrap_at is sometimes a bool, ensure it falls back to a valid number in the call to math.min

This commit is contained in:
Tony Kuneck 2020-10-04 01:06:44 -07:00
parent f6ac375604
commit 6d066af27a

View File

@ -807,7 +807,7 @@ function M.fancy_floating_markdown(contents, opts)
h.start = h.start + i - 1
h.finish = h.finish + i - 1
if h.finish + 1 <= #stripped then
table.insert(stripped, h.finish + 1, string.rep("", math.min(width, opts.wrap_at)))
table.insert(stripped, h.finish + 1, string.rep("", math.min(width, opts.wrap_at or width)))
height = height + 1
end
end