feat: support per-block separator theme overrides - #2299
Draft
cfsmp3 wants to merge 1 commit into
Draft
Conversation
cfsmp3
force-pushed
the
fix_per_block_separators
branch
from
August 1, 2026 07:51
f5a9842 to
c6ecf6f
Compare
Separator settings (separator, separator_fg, separator_bg, start_separator, end_separator) in a block's theme_overrides were silently ignored: separators are rendered across blocks in print_blocks(), which only had access to the global theme (left as a TODO in greshake#947). Carry each block's overridden theme in its RenderedBlock, and take each separator's settings from the theme of the block it precedes (end_separator: from the last block's theme). Blocks without overrides carry the global theme, so nothing changes when the feature is unused. The separator rendering is extracted into render_blocks(), which returns the segments instead of printing them, so it is now covered by unit tests. Fixes greshake#2200
cfsmp3
force-pushed
the
fix_per_block_separators
branch
2 times, most recently
from
August 3, 2026 16:40
abf45b5 to
6e5d0bf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Separator settings (
separator,separator_fg,separator_bg,start_separator,end_separator) in a block's[block.theme_overrides]were silently ignored: separators are rendered between blocks inprint_blocks(), which only had access to the global theme. This was left as a TODO in #947 and reported in #2200, where it was noted there's no reason not to add it now.Design
The one real decision here is which block's theme a separator between two blocks belongs to. This PR: a separator takes its settings from the theme of the block it precedes, and
end_separatortakes them from the last block's theme. Rationale: the separator's auto-FG already comes from the background of the block it precedes, so that block was always the separator's "owner" visually. Documented indoc/themes.md.Implementation
RenderedBlocknow carries the block's override-appliedArc<Theme>(captured at spawn, cheap clone).print_blocks()split: the rendering logic moved torender_blocks()which returns the segments instead of printing, making it unit-testable; separator decisions now read the per-block theme.theme_overridescarry the global theme, so rendering is byte-for-byte identical when the feature is unused (covered by a test).Tests
separator_fgtaken from the preceding block's overridesstart_separator/end_separatorFixes #2200