Set horizontal scroll size to be more in line with other editors

Only scroll enough to see the whole line.
This commit is contained in:
Guldoman 2021-08-28 20:09:38 +02:00 committed by Francesco
parent 2d33fdc656
commit 4a03aec073
1 changed files with 4 additions and 2 deletions

View File

@ -104,8 +104,10 @@ function DocView:get_scrollable_size()
long_line = l
break
end
return self:get_line_height() * (#self.doc.lines - 1) + self.size.y,
self:get_col_x_offset(long_line, self.doc.long_lines.length) + self.size.x - xmargin
local size_v = self:get_line_height() * (#self.doc.lines - 1) + self.size.y
local size_h = self:get_col_x_offset(long_line, self.doc.long_lines.length)
+ self.size.x - (self.size.x - self:get_gutter_width()) + xmargin
return size_v, size_h
end