=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/screen-redraw.c,v retrieving revision 1.82 retrieving revision 1.83 diff -u -r1.82 -r1.83 --- src/usr.bin/tmux/screen-redraw.c 2020/12/07 09:46:58 1.82 +++ src/usr.bin/tmux/screen-redraw.c 2021/02/05 12:29:18 1.83 @@ -1,4 +1,4 @@ -/* $OpenBSD: screen-redraw.c,v 1.82 2020/12/07 09:46:58 nicm Exp $ */ +/* $OpenBSD: screen-redraw.c,v 1.83 2021/02/05 12:29:18 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -32,8 +32,8 @@ struct screen_redraw_ctx *); #define CELL_INSIDE 0 -#define CELL_LEFTRIGHT 1 -#define CELL_TOPBOTTOM 2 +#define CELL_TOPBOTTOM 1 +#define CELL_LEFTRIGHT 2 #define CELL_TOPLEFT 3 #define CELL_TOPRIGHT 4 #define CELL_BOTTOMLEFT 5 @@ -47,6 +47,9 @@ #define CELL_BORDERS " xqlkmjwvtun~" +#define START_ISOLATE "\342\201\246" +#define END_ISOLATE "\342\201\251" + static const struct utf8_data screen_redraw_double_borders[] = { { "", 0, 0, 0 }, { "\342\225\221", 0, 3, 1 }, /* U+2551 */ @@ -299,7 +302,7 @@ case 13: /* 1101, left right bottom */ return (CELL_TOPJOIN); case 12: /* 1100, left right */ - return (CELL_TOPBOTTOM); + return (CELL_LEFTRIGHT); case 11: /* 1011, left top bottom */ return (CELL_RIGHTJOIN); case 10: /* 1010, left top */ @@ -313,7 +316,7 @@ case 5: /* 0101, right bottom */ return (CELL_TOPLEFT); case 3: /* 0011, top bottom */ - return (CELL_LEFTRIGHT); + return (CELL_TOPBOTTOM); } return (CELL_OUTSIDE); } @@ -680,7 +683,7 @@ struct tty *tty = &c->tty; struct window_pane *wp; u_int cell_type, x = ctx->ox + i, y = ctx->oy + j; - int pane_status = ctx->pane_status; + int pane_status = ctx->pane_status, isolates; struct grid_cell gc; const struct grid_cell *tmp; @@ -705,11 +708,22 @@ } screen_redraw_border_set(wp, ctx->pane_lines, cell_type, &gc); + if (cell_type == CELL_TOPBOTTOM && + (c->flags & CLIENT_UTF8) && + tty_term_has(tty->term, TTYC_BIDI)) + isolates = 1; + else + isolates = 0; + if (ctx->statustop) tty_cursor(tty, i, ctx->statuslines + j); else tty_cursor(tty, i, j); + if (isolates) + tty_puts(tty, END_ISOLATE); tty_cell(tty, &gc, &grid_default_cell, NULL); + if (isolates) + tty_puts(tty, START_ISOLATE); } /* Draw the borders. */