Add option to disable scrolling past the end (#566)
This commit is contained in:
parent
cf11d67895
commit
ab0ca031fa
|
@ -5,6 +5,7 @@ config.fps = 60
|
||||||
config.max_log_items = 80
|
config.max_log_items = 80
|
||||||
config.message_timeout = 5
|
config.message_timeout = 5
|
||||||
config.mouse_wheel_scroll = 50 * SCALE
|
config.mouse_wheel_scroll = 50 * SCALE
|
||||||
|
config.scroll_past_end = true
|
||||||
config.file_size_limit = 10
|
config.file_size_limit = 10
|
||||||
config.ignore_files = "^%."
|
config.ignore_files = "^%."
|
||||||
config.symbol_pattern = "[%a_][%w_]*"
|
config.symbol_pattern = "[%a_][%w_]*"
|
||||||
|
|
|
@ -98,6 +98,9 @@ end
|
||||||
|
|
||||||
|
|
||||||
function DocView:get_scrollable_size()
|
function DocView:get_scrollable_size()
|
||||||
|
if not config.scroll_past_end then
|
||||||
|
return self:get_line_height() * (#self.doc.lines) + style.padding.y * 2
|
||||||
|
end
|
||||||
return self:get_line_height() * (#self.doc.lines - 1) + self.size.y
|
return self:get_line_height() * (#self.doc.lines - 1) + self.size.y
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue