Skip to content

fix: emit_bg_palindex updates wrong state tracker (lastr -> lastbr)#2920

Open
deths74r wants to merge 1 commit intodankamongmen:masterfrom
deths74r:fix/emit-bg-palindex-tracker
Open

fix: emit_bg_palindex updates wrong state tracker (lastr -> lastbr)#2920
deths74r wants to merge 1 commit intodankamongmen:masterfrom
deths74r:fix/emit-bg-palindex-tracker

Conversation

@deths74r
Copy link

Summary

emit_bg_palindex() writes the background palette index to nc->rstate.lastr (the foreground palette tracker) instead of nc->rstate.lastbr (the background palette tracker).

This corrupts foreground elision state when a palette-indexed background color is emitted, potentially causing incorrect foreground color elision on subsequent cells.

Fix

One-character fix: lastrlastbr.

For comparison, emit_fg_palindex() correctly writes to nc->rstate.lastr, and the bg RGB counterpart correctly writes to nc->rstate.lastbr.

emit_bg_palindex() writes the background palette index to nc->rstate.lastr (the foreground palette tracker) instead of nc->rstate.lastbr (the background palette tracker). This corrupts foreground elision state when a palette-indexed background color is emitted, potentially causing incorrect foreground colors on subsequent cells. Fix: change lastr to lastbr.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant