From ea1d46bc0443b0df5d3d7ee8832d60b328dbfaca Mon Sep 17 00:00:00 2001
From: Mooffie <mooffie@gmail.com>
Date: Tue, 10 Jan 2017 02:07:03 +0200
Subject: [PATCH] Ticket #3754: Help dialog doesn't handle tabs correctly.
Upon seeing a tab, the help viewer effectively pushes the *current* word
forward.
Instead, it should first finish handling the current word (that is, print it on
screen) and only then adjust the column.
Signed-off-by: Mooffie <mooffie@gmail.com>
---
src/help.c | 22 +++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)
diff --git a/src/help.c b/src/help.c
index eecb932..ccdbb94 100644
a
|
b
|
help_show (WDialog * h, const char *paint_start) |
531 | 531 | line++; |
532 | 532 | col = 0; |
533 | 533 | break; |
534 | | case '\t': |
535 | | col = (col / 8 + 1) * 8; |
536 | | if (col >= HELP_WINDOW_WIDTH) |
537 | | { |
538 | | line++; |
539 | | col = 8; |
540 | | } |
541 | | break; |
542 | 534 | case ' ': |
| 535 | case '\t': |
543 | 536 | /* word delimiter */ |
544 | 537 | if (painting) |
545 | | help_print_word (h, word, &col, &line, TRUE); |
| 538 | { |
| 539 | help_print_word (h, word, &col, &line, c == ' '); |
| 540 | if (c == '\t') |
| 541 | { |
| 542 | col = (col / 8 + 1) * 8; |
| 543 | if (col >= HELP_WINDOW_WIDTH) |
| 544 | { |
| 545 | line++; |
| 546 | col = 8; |
| 547 | } |
| 548 | } |
| 549 | } |
546 | 550 | break; |
547 | 551 | default: |
548 | 552 | if (painting && (line < help_lines)) |