]> granicus.if.org Git - nethack/commitdiff
curses text windows
authorPatR <rankin@nethack.org>
Thu, 20 Jun 2019 08:14:50 +0000 (01:14 -0700)
committerPatR <rankin@nethack.org>
Thu, 20 Jun 2019 08:14:50 +0000 (01:14 -0700)
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.

doc/fixes36.3
win/curses/cursdial.c

index 23780792cfe1490a6be9d2624dbd8b9d16492626..11ac2c8829608814ae8bdbb5eb8d73938fdae455 100644 (file)
@@ -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 <return> or <enter> key) into ^J; both ^J and ^M
        off) and ^M is not bound to any command, so accidental <return> 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
index 2f2f5fccecd26eee324b85762423b238fa7a3552..656d3b6a74e25d7a3ff42d18628b9254ed9ca02d 100644 (file)
@@ -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;