summaryrefslogtreecommitdiffstats
path: root/tty.c
diff options
context:
space:
mode:
authornicm <nicm>2021-08-17 08:44:52 +0000
committernicm <nicm>2021-08-17 08:44:52 +0000
commit41ababdf6c0529d4336a1daf3418ad314c373614 (patch)
tree5311864f5be4a265ef7a1d80f7ed82e4aee3515e /tty.c
parent1a7eb6ca9006208b8b76c6a2a5a92c66648c03da (diff)
Be more sophisticated about enabling synchronized updates when there is
an overlay and treat it like the active pane (use for commands which move the cursor only). When there is an overlay also use it for all panes and not just the active pane. GitHub issue 2826.
Diffstat (limited to 'tty.c')
-rw-r--r--tty.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/tty.c b/tty.c
index 2a9f8b01..f93f6c57 100644
--- a/tty.c
+++ b/tty.c
@@ -2039,9 +2039,22 @@ tty_cmd_rawstring(struct tty *tty, const struct tty_ctx *ctx)
}
void
-tty_cmd_syncstart(struct tty *tty, __unused const struct tty_ctx *ctx)
+tty_cmd_syncstart(struct tty *tty, const struct tty_ctx *ctx)
{
- tty_sync_start(tty);
+ if (ctx->num == 0x11) {
+ /*
+ * This is an overlay and a command that moves, the cursor so
+ * start synchronized updates.
+ */
+ tty_sync_start(tty);
+ } else if (~ctx->num & 0x10) {
+ /*
+ * This is a pane. If there is an overlay, always start;
+ * otherwise, only if requested.
+ */
+ if (ctx->num || tty->client->overlay_draw != NULL)
+ tty_sync_start(tty);
+ }
}
void