feat: configure cursor distance from viewport edges

This commit is contained in:
2026-10-13 22:10:47 +02:00
parent 00628e0efd
commit b58fb085a3
11 changed files with 592 additions and 82 deletions
+8
View File
@@ -141,6 +141,7 @@ module Vamp
@bar = BarConfig.new
@popup = PopupConfig.new
@labels = {}
@scroll_distance = 0
@diff_context_lines = 10
@diff_expand_lines = 15
@diff_view_mode = "split"
@@ -214,6 +215,12 @@ module Vamp
end
end
# @param distance [Integer, nil] nonnegative cursor margin, or nil to center
# @return [Integer, nil]
def scroll_distance=(distance)
@scroll_distance = distance.nil? ? nil : diff_line_count!(distance, "scroll_distance", 0)
end
# @param lines [Integer] nonnegative context lines around each diff change
# @return [Integer]
def diff_context_lines=(lines)
@@ -285,6 +292,7 @@ module Vamp
"file_explorer_view" => @file_explorer_view, "clipboard_mode" => @clipboard_mode,
"git_blame" => @git_blame,
"git_gutter" => @git_gutter,
"scroll_distance" => @scroll_distance,
"top_bar" => @bar.top, "bottom_bar" => @bar.bottom, "labels" => @labels,
"popup" => { "command" => @popup.command, "search" => @popup.search },
"diff_context_lines" => @diff_context_lines, "diff_expand_lines" => @diff_expand_lines,