Make `linewrapping` consider the expanded `Scrollbar` size

This avoids reflowing the text when hovering the scrollbar.
This commit is contained in:
Guldoman 2023-09-07 04:07:21 +02:00 committed by George Sokianos
parent e5c17ed3ec
commit febfcb5757
1 changed files with 1 additions and 1 deletions

View File

@ -219,7 +219,7 @@ function LineWrapping.draw_guide(docview)
end
function LineWrapping.update_docview_breaks(docview)
local x,y,w,h = docview.v_scrollbar:get_thumb_rect()
local w = docview.v_scrollbar.expanded_size or style.expanded_scrollbar_size
local width = (type(config.plugins.linewrapping.width_override) == "function" and config.plugins.linewrapping.width_override(docview))
or config.plugins.linewrapping.width_override or (docview.size.x - docview:get_gutter_width() - w)
if (not docview.wrapped_settings or docview.wrapped_settings.width == nil or width ~= docview.wrapped_settings.width) then