Revert "src/help.c: minor refactoring."

This reverts commit f070d94275c0e41bed4878caf60f8254473f3486.
Help is displayed incorrectly.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2009-08-09 21:40:55 +04:00
parent d7d3267594
commit 791404055b
1 changed files with 18 additions and 18 deletions

View File

@ -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;
}
}