1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-09-22 19:45:54 -04:00

Simple word wrap

This commit is contained in:
James Booth 2014-11-08 21:16:16 +00:00
parent ecef8f7956
commit da376b26d6

View File

@ -610,6 +610,16 @@ _win_print_wrapped(WINDOW *win, const char * const message)
word[wordi++] = message[linei++]; word[wordi++] = message[linei++];
} }
word[wordi] = '\0'; word[wordi] = '\0';
int curx = getcurx(win);
int maxx = getmaxx(win);
if (curx + strlen(word) > maxx) {
wprintw(win, "\n ");
}
if (curx < 11) {
wprintw(win, " ");
}
wprintw(win, "%s", word); wprintw(win, "%s", word);
} }
} }