commit b637f33f3da5508384cbe4b360c8ef37ce0c1811 from: Mark Jamsek date: Wed Feb 01 13:22:19 2023 UTC fix OB1 in tog ref and tree views causing wrapped lines While here, draw to the last column in tog help. ok op@ and stsp@ commit - 466be1387519f6af17726af568d8943cbcf0e66c commit + b637f33f3da5508384cbe4b360c8ef37ce0c1811 blob - c1730a93d0f5558332b281e3b842aea06d9748f0 blob + 18fd85d80ae64e33a4203855e707a424341027e8 --- tog/tog.c +++ tog/tog.c @@ -6921,7 +6921,7 @@ draw_tree_entries(struct tog_view *view, const char *p if (tc) wattr_off(view->window, COLOR_PAIR(tc->colorpair), NULL); - if (width < view->ncols - 1) + if (width < view->ncols) waddch(view->window, '\n'); if (n == s->selected && view->focussed) wstandend(view->window); @@ -8183,7 +8183,7 @@ show_ref_view(struct tog_view *view) if (tc) wattr_off(view->window, COLOR_PAIR(tc->colorpair), NULL); - if (width < view->ncols - 1) + if (width < view->ncols) waddch(view->window, '\n'); if (n == s->selected && view->focussed) wstandend(view->window); @@ -8829,22 +8829,20 @@ show_help_view(struct tog_view *view) int skip; err = format_line(&wline, &width, &skip, line, - view->x, view->ncols - 1, 0, view->x ? 1 : 0); + view->x, view->ncols, 0, view->x ? 1 : 0); if (err) { free(line); return err; } - rc = waddwstr(view->window, &wline[skip]); + waddwstr(view->window, &wline[skip]); free(wline); wline = NULL; - if (rc == ERR) - return got_error_msg(GOT_ERR_IO, "waddwstr"); } if (s->lineno == view->hiline) { while (width++ < view->ncols) waddch(view->window, ' '); } else { - if (width <= view->ncols) + if (width < view->ncols) waddch(view->window, '\n'); } if (attr)