- sub = derwin(win, 1, width, y0, x0);
+ if (single) {
+ /*
+ * Allocate a single-line derived window extending from the current
+ * cursor position to the end of the current line in the given window.
+ * Disable scrolling in the derived window.
+ */
+ sub = derwin(win, 1, width, y0, x0);
+ } else {
+ /*
+ * Allow printw to wrap through the entire window.
+ */
+ sub = derwin(win, getmaxy(win), getmaxx(win), 0, 0);
+ wmove(sub, y0, x0);
+ }