feat: dim whitespace markers and configure scope and newlines

This commit is contained in:
2026-10-13 23:18:39 +02:00
parent adcc4f2656
commit 11b31d2621
10 changed files with 964 additions and 112 deletions
+11
View File
@@ -144,6 +144,7 @@ module Vamp
@scroll_distance = 0
@highlight_trailing_whitespace = false
@whitespace_characters = {}
@whitespace_scope = "all"
@diff_context_lines = 10
@diff_expand_lines = 15
@diff_view_mode = "split"
@@ -244,6 +245,15 @@ module Vamp
@whitespace_characters = characters.dup
end
# @param scope [String] "all" or "leading"
# @return [String]
def whitespace_scope=(scope)
scope = Vamp.string!(scope, "whitespace_scope")
raise ArgumentError, "whitespace_scope must be all or leading" unless %w[all leading].include?(scope)
@whitespace_scope = scope
end
# @param lines [Integer] nonnegative context lines around each diff change
# @return [Integer]
def diff_context_lines=(lines)
@@ -318,6 +328,7 @@ module Vamp
"scroll_distance" => @scroll_distance,
"highlight_trailing_whitespace" => @highlight_trailing_whitespace,
"whitespace_characters" => @whitespace_characters,
"whitespace_scope" => @whitespace_scope,
"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,