Turn off scrollbar when pane is in alternate screen, from Michael Grant,

GitHub issue 4231.
This commit is contained in:
nicm
2024-11-15 09:01:16 +00:00
parent f527412d9b
commit d6883c0266
7 changed files with 34 additions and 43 deletions

View File

@ -1726,3 +1726,16 @@ window_pane_mode(struct window_pane *wp)
}
return (WINDOW_PANE_NO_MODE);
}
/* Return 1 if scrollbar is or should be displayed. */
int
window_pane_show_scrollbar(struct window_pane *wp, int sb_option)
{
if (SCREEN_IS_ALTERNATE(wp->screen))
return (0);
if (sb_option == PANE_SCROLLBARS_ALWAYS ||
(sb_option == PANE_SCROLLBARS_MODAL &&
window_pane_mode(wp) != WINDOW_PANE_NO_MODE))
return (1);
return (0);
}