`linewrapping`: Disable horizontal scrolling when enabled (#1309)

This commit is contained in:
Guldoman 2023-01-05 22:02:12 +01:00 committed by takase1121
parent 1ab320bb9b
commit f00f41b468
No known key found for this signature in database
GPG Key ID: 60EEFFC68EB3031B
1 changed files with 6 additions and 0 deletions

View File

@ -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)