From: PatR Date: Thu, 20 Jun 2019 08:14:50 +0000 (-0700) Subject: curses text windows X-Git-Tag: nmake-explicit-path~2^2~32 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9f6588af49766c00998291ff79735922199c8563;p=nethack curses text windows Most of the entries for '?' looked awful because curses was using ((terminal_width / 2) - 2) for the window width ('- 2' was to make for for a border around the popup window, regardless of what the 'windowborder' option was set to). Splitting text that has been manually formatted for 80 columns "worked" but looked bad when not required. Some of the help files are using 79 characters on a few lines, producing wrapped text when displayed. Those would look better if limited them to 78 or if curses can be modified to suppress the window border when the entire display is being covered by a popup. --- diff --git a/doc/fixes36.3 b/doc/fixes36.3 index 23780792c..11ac2c882 100644 --- a/doc/fixes36.3 +++ b/doc/fixes36.3 @@ -1,4 +1,4 @@ -$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.57 $ $NHDT-Date: 1560855142 2019/06/18 10:52:22 $ +$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.58 $ $NHDT-Date: 1561018485 2019/06/20 08:14:45 $ This fixes36.3 file is here to capture information about updates in the 3.6.x lineage following the release of 3.6.2 in May 2019. Please note, however, @@ -129,6 +129,7 @@ curses: don't convert ^M (or or key) into ^J; both ^J and ^M off) and ^M is not bound to any command, so accidental won't cause the hero to try to move curses: draw map in screen columns 1..79 like tty, rather than in 2..80 +curses: make text windows wider so that help feedback is more readable curses+EDIT_GETLIN: when a prompt's answer was preloaded, using ESC to discard it deleted it from the answer buffer but didn't erase it from screen tty: re-do one optimization used when status conditions have all been removed diff --git a/win/curses/cursdial.c b/win/curses/cursdial.c index 2f2f5fcce..656d3b6a7 100644 --- a/win/curses/cursdial.c +++ b/win/curses/cursdial.c @@ -1025,8 +1025,11 @@ menu_win_size(nhmenu *menu) /* Try not to wrap headers/normal text lines if possible. We can go wider than half the screen for this purpose if need be */ - if ((maxheaderwidth > maxwidth) && (maxheaderwidth < (term_cols - 2))) { - maxwidth = maxheaderwidth; + if (maxheaderwidth > maxwidth) { + if (maxheaderwidth < (term_cols - 2)) + maxwidth = maxheaderwidth; + else + maxwidth = term_cols - 2; } width = maxwidth;