diff --git a/configure.ac b/configure.ac index 093d855bb..63541c2df 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ # configure.ac -AC_INIT([tmux], next-3.7) +AC_INIT([tmux], 3.7-rc2) AC_PREREQ([2.60]) AC_CONFIG_AUX_DIR(etc) diff --git a/server-client.c b/server-client.c index 25719f366..20536804e 100644 --- a/server-client.c +++ b/server-client.c @@ -695,12 +695,8 @@ server_client_check_mouse_in_pane(struct window_pane *wp, int px, int py, bdr_bottom = fwp->yoff + fwp->sy; if (py == bdr_bottom) break; - if (window_pane_is_floating(wp)) { - /* Floating pane, check top border. */ - bdr_top = fwp->yoff - 1; - if (py == bdr_top) - break; - } + if (py == bdr_top) + break; } } if (fwp != NULL) diff --git a/sort.c b/sort.c index fda6a90ba..212da22ea 100644 --- a/sort.c +++ b/sort.c @@ -65,7 +65,12 @@ sort_buffer_cmp(const void *a0, const void *b0) result = strcmp(pa->name, pb->name); break; case SORT_CREATION: - result = pa->order - pb->order; + if (pa->order > pb->order) + result = -1; + else if (pa->order < pb->order) + result = 1; + else + result = 0; break; case SORT_SIZE: result = pa->size - pb->size; @@ -251,11 +256,11 @@ sort_winlink_cmp(const void *a0, const void *b0) break; case SORT_CREATION: if (timercmp(&wa->creation_time, &wb->creation_time, >)) { - result = -1; + result = 1; break; } if (timercmp(&wa->creation_time, &wb->creation_time, <)) { - result = 1; + result = -1; break; } break; diff --git a/tty.c b/tty.c index f201ba1d1..5fd29130b 100644 --- a/tty.c +++ b/tty.c @@ -2051,6 +2051,8 @@ tty_cmd_cell(struct tty *tty, const struct tty_ctx *ctx) tty_region_pane(tty, ctx, ctx->orupper, ctx->orlower); tty_margin_off(tty); + if (ctx->flags & TTY_CTX_CELL_INVALIDATE) + tty_invalidate(tty); tty_cursor_pane_unless_wrap(tty, ctx, ctx->ocx, ctx->ocy); tty_cell(tty, ctx->cell, &ctx->defaults, ctx->palette, diff --git a/utf8-combined.c b/utf8-combined.c index 65ecf9cdc..923342b43 100644 --- a/utf8-combined.c +++ b/utf8-combined.c @@ -82,6 +82,23 @@ utf8_is_hangul_filler(const struct utf8_data *ud) return (memcmp(ud->data, "\343\205\244", 3) == 0); } +/* Count regional indicator characters. */ +static u_int +utf8_regional_count(const struct utf8_data *ud) +{ + u_int count = 0, i; + + for (i = 0; i + 4 <= ud->size; i++) { + if (ud->data[i] == 0xf0 && + ud->data[i + 1] == 0x9f && + ud->data[i + 2] == 0x87 && + ud->data[i + 3] >= 0xa6 && + ud->data[i + 3] <= 0xbf) + count++; + } + return (count); +} + /* Should these two characters combine? */ int utf8_should_combine(const struct utf8_data *with, const struct utf8_data *add) @@ -94,8 +111,13 @@ utf8_should_combine(const struct utf8_data *with, const struct utf8_data *add) return (0); /* Regional indicators. */ - if ((a >= 0x1F1E6 && a <= 0x1F1FF) && (w >= 0x1F1E6 && w <= 0x1F1FF)) + if ((a >= 0x1F1E6 && a <= 0x1F1FF) && (w >= 0x1F1E6 && w <= 0x1F1FF)) { + if (utf8_regional_count(with) != 1) + return (0); + if (utf8_regional_count(add) != 1) + return (0); return (1); + } /* Emoji skin tone modifiers. */ switch (a) { diff --git a/window.c b/window.c index 0d86ac508..314415889 100644 --- a/window.c +++ b/window.c @@ -628,12 +628,32 @@ window_get_active_at(struct window *w, u_int x, u_int y) pane_status = options_get_number(w->options, "pane-border-status"); + if (pane_status == PANE_STATUS_TOP) { + /* + * Prefer a pane's top border status line over the pane above's + * bottom border. + */ + TAILQ_FOREACH(wp, &w->z_index, zentry) { + if (!window_pane_visible(wp) || window_pane_is_floating(wp)) + continue; + + window_pane_full_size_offset(wp, &xoff, &yoff, &sx, &sy); + if ((int)x < xoff || x > xoff + sx) + continue; + if ((int)y == yoff - 1) + return (wp); + } + } + TAILQ_FOREACH(wp, &w->z_index, zentry) { if (!window_pane_visible(wp)) continue; window_pane_full_size_offset(wp, &xoff, &yoff, &sx, &sy); if (!window_pane_is_floating(wp)) { - /* Tiled - to and including bottom or right border. */ + /* + * Tiled - to and including the right border, excluding + * the bottom border. + */ if ((int)x < xoff || x > xoff + sx) continue; if (pane_status == PANE_STATUS_TOP) {