feat: add split_width for better sentence display

This commit is contained in:
JuanZoran
2023-03-23 20:24:17 +08:00
parent a3b0a21d08
commit 9b8c091a33
5 changed files with 50 additions and 29 deletions

View File

@ -209,7 +209,11 @@ function M:process(data)
local window = self.window
if window and window:is_valid() then
if opts.auto_resize then
display_size.width = math.min(opts.width, display_size.width + opts.padding)
display_size.width = math.max(
math.min(opts.width, display_size.width + opts.padding),
math.min(data.str:width(), opts.split_width)
)
else
display_size.width = nil
end