feat: configure half-page viewport scroll distance

This commit is contained in:
Valdemar Lorenzen
2026-10-16 10:25:27 +02:00
parent 5a8c37b2f2
commit 284ddd3713
11 changed files with 96 additions and 7 deletions
+8
View File
@@ -145,6 +145,7 @@ module Vamp
@popup = PopupConfig.new
@labels = {}
@scroll_distance = 0
@scroll_half_page_lines = nil
@highlight_trailing_whitespace = false
@whitespace_characters = {}
@whitespace_scope = "all"
@@ -229,6 +230,12 @@ module Vamp
@scroll_distance = distance.nil? ? nil : diff_line_count!(distance, "scroll_distance", 0)
end
# @param lines [Integer, nil] positive screen rows, or nil for half the viewport
# @return [Integer, nil]
def scroll_half_page_lines=(lines)
@scroll_half_page_lines = lines.nil? ? nil : diff_line_count!(lines, "scroll_half_page_lines", 1)
end
# @param enabled [Boolean]
# @return [Boolean]
def highlight_trailing_whitespace=(enabled)
@@ -343,6 +350,7 @@ module Vamp
"git_blame" => @git_blame,
"git_gutter" => @git_gutter,
"scroll_distance" => @scroll_distance,
"scroll_half_page_lines" => @scroll_half_page_lines,
"highlight_trailing_whitespace" => @highlight_trailing_whitespace,
"whitespace_characters" => @whitespace_characters,
"whitespace_scope" => @whitespace_scope,