From 791404055bfb1570549e2c73c05a887b05628433 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Sun, 9 Aug 2009 21:40:55 +0400 Subject: [PATCH] Revert "src/help.c: minor refactoring." This reverts commit f070d94275c0e41bed4878caf60f8254473f3486. Help is displayed incorrectly. Signed-off-by: Andrew Borodin --- src/help.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/help.c b/src/help.c index ab83274d2..65d6111e5 100644 --- a/src/help.c +++ b/src/help.c @@ -345,7 +345,7 @@ static void help_show (Dlg_head *h, const char *paint_start) const char *p, *n; int col, line, c, w; int painting = 1; - gboolean acs; /* Flag: Alternate character set active? */ + int acs; /* Flag: Alternate character set active? */ int repeat_paint; int active_col, active_line;/* Active link position */ static char buff[MB_LEN_MAX + 1]; @@ -353,9 +353,8 @@ static void help_show (Dlg_head *h, const char *paint_start) tty_setcolor (HELP_NORMAL_COLOR); do { - line = col = active_col = active_line = repeat_paint = 0; - acs = FALSE; - + line = col = acs = active_col = active_line = repeat_paint = 0; + clear_link_areas (); if (selected_item < paint_start) selected_item = NULL; @@ -368,7 +367,7 @@ static void help_show (Dlg_head *h, const char *paint_start) memcpy (buff, p, n - p); buff[n - p] = '\0'; c = (unsigned char) buff[0]; - + switch (c){ case CHAR_LINK_START: if (selected_item == NULL) @@ -393,10 +392,10 @@ static void help_show (Dlg_head *h, const char *paint_start) tty_setcolor (HELP_NORMAL_COLOR); break; case CHAR_ALTERNATE: - acs = TRUE; + acs = 1; break; case CHAR_NORMAL: - acs = TRUE; + acs = 0; break; case CHAR_VERSION: dlg_move (h, line+2, col+2); @@ -426,19 +425,20 @@ static void help_show (Dlg_head *h, const char *paint_start) if (col + w > HELP_WINDOW_WIDTH) continue; - dlg_move (h, line + 2, col + 2); - - if (!acs) - tty_print_string (buff); - else if (c == ' ' || c == '.') - tty_print_char (c); - else -#ifdef HAVE_SLANG - tty_print_alt_char (c); + dlg_move (h, line+2, col+2); + if (acs){ + if (c == ' ' || c == '.') + tty_print_char (c); + else +#ifndef HAVE_SLANG + tty_print_char (acs_map [c]); #else - tty_print_char (acs_map [c]); + SLsmg_draw_object (h->y + line + 2, h->x + col + 2, c); #endif - col += w; + } else { + tty_print_string (buff); + } + col+= w; break; } }