render: scrollback indicator: only leave room for search box when necessary

This commit is contained in:
Daniel Eklöf 2020-08-26 19:12:12 +02:00
parent 1109865c8e
commit c8d0dc5750
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -1469,7 +1469,11 @@ render_scrollback_position(struct terminal *term)
break;
case SCROLLBACK_INDICATOR_POSITION_RELATIVE: {
int lines = term->rows - 3; /* Avoid using first and two last rows */
int lines = term->rows - 2; /* Avoid using first and last rows */
if (term->is_searching) {
/* Make sure we don't collide with the scrollback search box */
lines--;
}
assert(lines > 0);
int pixels = lines * term->cell_height - height + 2 * margin;