Bugfix status line at top and floating panes.

This commit is contained in:
Michael Grant 2025-12-09 00:14:06 +00:00
parent 2ac78bccb5
commit 2591df66cc
3 changed files with 13 additions and 10 deletions

View File

@ -671,12 +671,12 @@ screen_redraw_draw_pane_status(struct screen_redraw_ctx *ctx)
width = size - x;
}
if (ctx->statustop)
yoff += ctx->statuslines;
vr = screen_redraw_get_visible_ranges(wp, x, yoff - ctx->oy,
width);
if (ctx->statustop)
yoff += ctx->statuslines;
for (r=0; r < vr->used; r++) {
if (vr->nx[r] == 0)
continue;
@ -1173,7 +1173,7 @@ screen_redraw_draw_pane(struct screen_redraw_ctx *ctx, struct window_pane *wp)
if (wp->yoff + (int)j < ctx->oy ||
wp->yoff + j >= ctx->oy + ctx->sy)
continue;
y = top + wp->yoff + j - ctx->oy;
y = wp->yoff + j - ctx->oy;
/* Note: i is apparenty not used now that the vr array
* returns where in s to read from.
@ -1217,7 +1217,7 @@ screen_redraw_draw_pane(struct screen_redraw_ctx *ctx, struct window_pane *wp)
* contents of pane shifted. note: i apparently unnec.
*/
tty_draw_line(tty, s, /* i + */ vr->px[r] - wp->xoff, j,
vr->nx[r], vr->px[r], y, &defaults, palette);
vr->nx[r], vr->px[r], top + y, &defaults, palette);
}
}
@ -1281,9 +1281,6 @@ screen_redraw_draw_pane_scrollbar(struct screen_redraw_ctx *ctx,
else
sb_x = xoff + wp->sx - ox;
if (ctx->statustop)
sb_y += ctx->statuslines;
if (slider_h < 1)
slider_h = 1;
if (slider_y >= sb_h)
@ -1313,8 +1310,11 @@ screen_redraw_draw_scrollbar(struct screen_redraw_ctx *ctx,
int yoff = wp->yoff;
struct visible_ranges *vr;
if (ctx->statustop)
if (ctx->statustop) {
sb_y += ctx->statuslines;
sy += ctx->statuslines;
}
/* Set up style for slider. */
gc = sb_style->gc;

View File

@ -1302,7 +1302,7 @@ have_event:
c->tty.mouse_drag_flag = MOUSE_BUTTONS(b) + 1;
/* Only change pane if not already dragging a pane border. */
if (c->tty.mouse_wp == NULL) {
wp = window_get_active_at(w, x, y);
wp = window_get_active_at(w, px, py);
c->tty.mouse_wp = wp;
}
if (c->tty.mouse_scrolling_flag == 0 &&

3
tty.c
View File

@ -2096,6 +2096,9 @@ tty_cmd_scrollup(struct tty *tty, const struct tty_ctx *ctx)
else
rlower = ctx->wsy - 1;
if (tty->client->session->statusat == 0)
rlower += tty->client->session->statuslines;
if (ctx->num == 1 || !tty_term_has(tty->term, TTYC_INDN)) {
if (!tty_use_margin(tty))
tty_cursor(tty, 0, rlower);