From b4e95b865c9a18ba4cb193ff7d2f3657d8995cd8 Mon Sep 17 00:00:00 2001 From: Guldoman Date: Thu, 7 Sep 2023 04:07:21 +0200 Subject: [PATCH] Make `linewrapping` consider the expanded `Scrollbar` size This avoids reflowing the text when hovering the scrollbar. --- data/plugins/linewrapping.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/plugins/linewrapping.lua b/data/plugins/linewrapping.lua index 62412720..0b9f0b76 100644 --- a/data/plugins/linewrapping.lua +++ b/data/plugins/linewrapping.lua @@ -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