From 529afada822a72887a94f17146460809134697d0 Mon Sep 17 00:00:00 2001 From: nicm Date: Sun, 7 Jun 2026 20:05:16 +0000 Subject: [PATCH] Move checking of whether the cursor is visible inside the if so that it always hits the calculation of the oy offset when the status line is at the top. From Michael Grant. --- server-client.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server-client.c b/server-client.c index dd4b6e08..481d5a71 100644 --- a/server-client.c +++ b/server-client.c @@ -1819,12 +1819,13 @@ server_client_reset_state(struct client *c) cx = wp->xoff + (int)s->cx - (int)ox; cy = wp->yoff + (int)s->cy - (int)oy; + r = screen_redraw_get_visible_ranges(wp, cx, cy, 1, NULL); + if (!screen_redraw_is_visible(r, cx)) + cursor = 0; + if (status_at_line(c) == 0) cy += status_line_size(c); } - r = screen_redraw_get_visible_ranges(wp, cx, cy, 1, NULL); - if (!screen_redraw_is_visible(r, cx)) - cursor = 0; if (!cursor) mode &= ~MODE_CURSOR;