mirror of
https://github.com/profanity-im/profanity.git
synced 2024-12-04 14:46:46 -05:00
Simple word wrap
This commit is contained in:
parent
ecef8f7956
commit
da376b26d6
@ -610,6 +610,16 @@ _win_print_wrapped(WINDOW *win, const char * const message)
|
||||
word[wordi++] = message[linei++];
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user