mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-30 11:10:23 -04:00
render: reverse video only swaps *default* fg/bg
This matches XTerm behavior, and fixes vttest 11.6.6.2: Test non-VT100 -> Test ISO-6429 colors -> Test of VT102-style features with BCE -> Test of screen features
This commit is contained in:
parent
95c4a8ccfb
commit
39560a6ff1
2 changed files with 7 additions and 4 deletions
|
|
@ -98,6 +98,9 @@
|
||||||
* `scrollback-*`+`pipe-scrollback` key bindings are now passed through
|
* `scrollback-*`+`pipe-scrollback` key bindings are now passed through
|
||||||
to the client application when the alt screen is active
|
to the client application when the alt screen is active
|
||||||
(https://codeberg.org/dnkl/foot/issues/573).
|
(https://codeberg.org/dnkl/foot/issues/573).
|
||||||
|
* Reverse video (`\E[?5h`) now only swaps the default foreground and
|
||||||
|
background colors. Cells with explicit foreground and/or background
|
||||||
|
colors remain unchanged.
|
||||||
|
|
||||||
|
|
||||||
### Deprecated
|
### Deprecated
|
||||||
|
|
|
||||||
8
render.c
8
render.c
|
|
@ -377,7 +377,7 @@ cursor_colors_for_cell(const struct terminal *term, const struct cell *cell,
|
||||||
term->cursor_color.text >> 31
|
term->cursor_color.text >> 31
|
||||||
? term->cursor_color.text : term->colors.bg);
|
? term->cursor_color.text : term->colors.bg);
|
||||||
|
|
||||||
if (term->reverse ^ cell->attrs.reverse ^ is_selected) {
|
if (cell->attrs.reverse ^ is_selected) {
|
||||||
pixman_color_t swap = *cursor_color;
|
pixman_color_t swap = *cursor_color;
|
||||||
*cursor_color = *text_color;
|
*cursor_color = *text_color;
|
||||||
*text_color = swap;
|
*text_color = swap;
|
||||||
|
|
@ -461,10 +461,10 @@ render_cell(struct terminal *term, pixman_image_t *pix,
|
||||||
_bg = term->colors.selection_bg;
|
_bg = term->colors.selection_bg;
|
||||||
} else {
|
} else {
|
||||||
/* Use cell specific color, if set, otherwise the default colors (possible reversed) */
|
/* Use cell specific color, if set, otherwise the default colors (possible reversed) */
|
||||||
_fg = cell->attrs.have_fg ? cell->attrs.fg : term->colors.fg;
|
_fg = cell->attrs.have_fg ? cell->attrs.fg : term->reverse ? term->colors.bg : term->colors.fg;
|
||||||
_bg = cell->attrs.have_bg ? cell->attrs.bg : term->colors.bg;
|
_bg = cell->attrs.have_bg ? cell->attrs.bg : term->reverse ? term->colors.fg : term->colors.bg;
|
||||||
|
|
||||||
if (term->reverse ^ cell->attrs.reverse ^ is_selected) {
|
if (cell->attrs.reverse ^ is_selected) {
|
||||||
uint32_t swap = _fg;
|
uint32_t swap = _fg;
|
||||||
_fg = _bg;
|
_fg = _bg;
|
||||||
_bg = swap;
|
_bg = swap;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue