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

This commit is contained in:
Guldoman 2023-01-05 22:02:12 +01:00 committed by GitHub
parent 6c6e5e9b99
commit 385ee69f94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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)