Only treat the first tab as the alignment point

master
C. McEnroe 2020-02-07 23:56:41 -05:00
parent 71b0536536
commit 0705f09310
1 changed files with 8 additions and 3 deletions

11
ui.c
View File

@ -384,9 +384,14 @@ static void wordWrap(WINDOW *win, const char *str) {
struct Style style = Reset; struct Style style = Reset;
while (*str) { while (*str) {
if (*str == '\t') { if (*str == '\t') {
waddch(win, ' '); if (align) {
getyx(win, y, align); waddch(win, '\t');
str++; str++;
} else {
waddch(win, ' ');
getyx(win, y, align);
str++;
}
} else if (*str == ' ') { } else if (*str == ' ') {
getyx(win, y, x); getyx(win, y, x);
const char *word = &str[strspn(str, " ")]; const char *word = &str[strspn(str, " ")];