From 974d478170dee352f620a156c46900266c3c9f12 Mon Sep 17 00:00:00 2001 From: PatR Date: Mon, 25 Apr 2016 14:25:52 -0700 Subject: [PATCH] tty menu coloring tweak Start coloring after the space which follows the selection indicator instead of on that space. The difference isn't noticeable when the highlighting is just a color, but it is if that highlighting includes inverse video or underline which visibly apply to spaces. So for a - entry A the old code produced a -######## and this revised code produces a - ####### where '#" indicates characters subject to menu coloring. --- win/tty/wintty.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/win/tty/wintty.c b/win/tty/wintty.c index 223447495..38fd61749 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 wintty.c $NHDT-Date: 1456907854 2016/03/02 08:37:34 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.125 $ */ +/* NetHack 3.6 wintty.c $NHDT-Date: 1461619522 2016/04/25 21:25:22 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.130 $ */ /* Copyright (c) David Cohrs, 1991 */ /* NetHack may be freely redistributed. See license for details. */ @@ -1820,9 +1820,11 @@ struct WinDesc *cw; lines (including fake ones that simulate grayed-out entries, so we don't rely on curr->identifier here) */ attr_n = 0; /* whole line */ - if (curr->str[0] && curr->str[1] && curr->str[2] - && curr->str[1] == ' ' && index("-+#", curr->str[2])) - attr_n = 2 + 1; /* after selection indicator */ + if (curr->str[0] && curr->str[1] == ' ' + && curr->str[2] && index("-+#", curr->str[2]) + && curr->str[3] == ' ') + /* [0]=letter, [1]==space, [2]=[-+#], [3]=space */ + attr_n = 4; /* [4:N]=entry description */ /* * Don't use xputs() because (1) under unix it calls