preserve background from line when computing span styles
This commit is contained in:
parent
7fffca04c3
commit
c97551a476
1 changed files with 15 additions and 1 deletions
16
src/tui.zig
16
src/tui.zig
|
|
@ -1539,9 +1539,23 @@ pub const App = struct {
|
||||||
// wins. Spans are expected to be small (<= ~15 per
|
// wins. Spans are expected to be small (<= ~15 per
|
||||||
// line for the review tab's column count), so a
|
// line for the review tab's column count), so a
|
||||||
// linear scan per cell is fine.
|
// linear scan per cell is fine.
|
||||||
|
//
|
||||||
|
// Span composition rule: spans describe a per-cell
|
||||||
|
// semantic intent (positive/negative/muted/etc.) —
|
||||||
|
// they own fg, bold, italic, underline. The row's
|
||||||
|
// base style owns bg (so a cursor-row's highlight
|
||||||
|
// bar reads as a continuous span across the whole
|
||||||
|
// row, not gappy where the colored cells land).
|
||||||
|
// `alt_*` (used by braille charts) keeps the
|
||||||
|
// legacy "replace fully" behavior since those
|
||||||
|
// overlays are decorative chart fills where the
|
||||||
|
// bg IS the signal.
|
||||||
if (line.spans) |spans| {
|
if (line.spans) |spans| {
|
||||||
for (spans) |sp| {
|
for (spans) |sp| {
|
||||||
if (col >= sp.start and col < sp.end) s = sp.style;
|
if (col >= sp.start and col < sp.end) {
|
||||||
|
s = sp.style;
|
||||||
|
s.bg = line.style.bg;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (line.alt_style) |alt| {
|
} else if (line.alt_style) |alt| {
|
||||||
if (col >= line.alt_start and col < line.alt_end) s = alt;
|
if (col >= line.alt_start and col < line.alt_end) s = alt;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue