From c2103b84dbb4240c9a6f30cae437d34606328388 Mon Sep 17 00:00:00 2001 From: nhmall Date: Tue, 15 May 2018 09:03:35 -0400 Subject: [PATCH] fix a couple of status items, gold highlighting and a boundary check typo gold highlighting boundary check on tty_curs() --- win/tty/wintty.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/win/tty/wintty.c b/win/tty/wintty.c index f9591c29e..8a2e30a02 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -3918,7 +3918,7 @@ int x, y; } else { /* Now we're truncating */ if (truncation_expected) - ; /* but we new in advance */ + ; /* but we knew in advance */ } } @@ -4158,6 +4158,11 @@ render_status(VOID_ARGS) } } } + if (x >= cw->cols) { + if (!truncation_expected) + paniclog("render_status()", " unexpected truncation."); + x = cw->cols - 1; + } tty_curs(WIN_STATUS, x, y); cl_end(); } else if (fldidx == BL_GOLD) { @@ -4167,9 +4172,21 @@ render_status(VOID_ARGS) * | Gold | * +-----------+ */ + if (iflags.hilite_delta) { + /* multiple attributes can be in effect concurrently */ + Begin_Attr(attridx); + if (do_color && coloridx != NO_COLOR + && coloridx != CLR_MAX) + term_start_color(coloridx); + } /* decode_mixed() due to GOLD glyph */ tty_putstatusfield(nullfield, decode_mixed(buf, text), x, y); + if (iflags.hilite_delta) { + if (do_color && coloridx != NO_COLOR) + term_end_color(); + End_Attr(attridx); + } } else if (hitpointbar) { /* * +-------------------------+