mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-08-02 03:16:21 +00:00
Simple word wrap
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user