From f00f41b46844b96f5ad85cbe0dcee1e6a9a29568 Mon Sep 17 00:00:00 2001 From: Guldoman Date: Thu, 5 Jan 2023 22:02:12 +0100 Subject: [PATCH] `linewrapping`: Disable horizontal scrolling when enabled (#1309) --- data/plugins/linewrapping.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/data/plugins/linewrapping.lua b/data/plugins/linewrapping.lua index cbfa3158..b287c523 100644 --- a/data/plugins/linewrapping.lua +++ b/data/plugins/linewrapping.lua @@ -355,6 +355,12 @@ function DocView:get_scrollable_size() return self:get_line_height() * (get_total_wrapped_lines(self) - 1) + self.size.y end +local old_get_h_scrollable_size = DocView.get_h_scrollable_size +function DocView:get_h_scrollable_size(...) + if self.wrapping_enabled then return 0 end + return old_get_h_scrollable_size(self, ...) +end + local old_new = DocView.new function DocView:new(doc) old_new(self, doc)