---
 examples/tmux.vim |  2 +-
 options-table.c   |  9 +++++++++
 screen-redraw.c   | 27 ++++++++++++++++++++++-----
 tmux.1            |  5 +++++
 tty-term.c        |  2 +-
 5 files changed, 38 insertions(+), 7 deletions(-)

diff --git a/examples/tmux.vim b/examples/tmux.vim
index e85f8ff..7547e35 100644
--- a/examples/tmux.vim
+++ b/examples/tmux.vim
@@ -70,7 +70,7 @@ syn keyword tmuxOptsSet
        \ message-command-fg message-fg message-limit
        \ mouse-resize-pane mouse-select-pane mouse-select-window mouse-utf8
        \ pane-active-border-bg pane-border-bg pane-active-border-fg
-       \ pane-border-fg prefix prefix2
+       \ pane-border-fg pane-active-border-mark prefix prefix2
        \ renumber-windows repeat-time set-remain-on-exit set-titles
        \ set-titles-string status status-attr status-bg status-fg
        \ status-interval status-justify status-keys status-left
diff --git a/options-table.c b/options-table.c
index 5da095b..7e15718 100644
--- a/options-table.c
+++ b/options-table.c
@@ -41,6 +41,9 @@ const char *options_table_mode_mouse_list[] = {
 const char *options_table_clock_mode_style_list[] = {
        "12", "24", NULL
 };
+const char *options_table_pane_active_border_mark_list[] = {
+       "none", "colorsplit", "arrows"
+};
 const char *options_table_status_keys_list[] = {
        "emacs", "vi", NULL
 };
@@ -260,6 +263,12 @@ const struct options_table_entry session_options_table[] = 
{
          .default_num = 2
        },
 
+       { .name = "pane-active-border-mark",
+         .type = OPTIONS_TABLE_CHOICE,
+         .choices = options_table_pane_active_border_mark_list,
+         .default_num = 0
+       },
+
        { .name = "pane-border-bg",
          .type = OPTIONS_TABLE_COLOUR,
          .default_num = 8
diff --git a/screen-redraw.c b/screen-redraw.c
index f5ffca2..6131907 100644
--- a/screen-redraw.c
+++ b/screen-redraw.c
@@ -53,6 +53,8 @@ void  screen_redraw_draw_number(struct client *, struct 
window_pane *);
 #define BORDER_TOP 4
 #define BORDER_BOTTOM 8
 
+#define BORDER_MARKERS " +, .   -"
+
 /* Check if cell is on border of given pane and how it relates to it. */
 int
 screen_redraw_get_border_rel(struct window_pane *wp, u_int px, u_int py)
@@ -228,7 +230,8 @@ screen_redraw_screen(struct client *c, int status_only, int 
borders_only)
        struct tty              *tty = &c->tty;
        struct window_pane      *wp;
        struct grid_cell         active_gc, other_gc;
-       u_int                    i, j, celltype, top;
+       u_int                    i, j, celltype, top,
+                                borderrel, to_mark, marktype;
        int                      status, spos, fg, bg;
 
        /* Suspended clients should not be updated. */
@@ -267,8 +270,10 @@ screen_redraw_screen(struct client *c, int status_only, 
int borders_only)
        colour_set_fg(&active_gc, fg);
        bg = options_get_number(oo, "pane-active-border-bg");
        colour_set_bg(&active_gc, bg);
+       marktype = options_get_number(oo, "pane-active-border-mark");
 
        /* Draw background and borders. */
+       to_mark = BORDER_LEFT|BORDER_RIGHT|BORDER_TOP|BORDER_BOTTOM;
        for (j = 0; j < tty->sy - status; j++) {
                if (status_only) {
                        if (spos == 1 && j != tty->sy - 1)
@@ -280,12 +285,24 @@ screen_redraw_screen(struct client *c, int status_only, 
int borders_only)
                        celltype = screen_redraw_get_cell_type(c, i, j, &wp);
                        if (celltype == CELL_INSIDE)
                                continue;
-                       if (screen_redraw_check_active_pane_indicator(i, j, 
celltype, w, wp))
-                               tty_attributes(tty, &active_gc);
+                       borderrel = screen_redraw_get_border_rel(w->active, i, 
j);
+                       if (marktype == 1) /* colorsplit */
+                               tty_attributes(tty, 
screen_redraw_check_active_pane_indicator(i, j, celltype, w, wp) ? &active_gc : 
&other_gc);
                        else
-                               tty_attributes(tty, &other_gc);
+                               tty_attributes(tty, borderrel != BORDER_NOT ? 
&active_gc : &other_gc);
+
                        tty_cursor(tty, i, top + j);
-                       tty_putc(tty, CELL_BORDERS[celltype]);
+
+                       if (marktype == 2 /* arrows */
+                           /* Arrow mark second cell of each active border not 
yet marked. */
+                           && borderrel != BORDER_NOT && to_mark & borderrel &&
+                           i > 0 && top + j > 0 &&
+                           /* Skip joints and corners. */
+                           (celltype == CELL_LEFTRIGHT || celltype == 
CELL_TOPBOTTOM)) {
+                               tty_putc(tty, BORDER_MARKERS[borderrel]);
+                               to_mark &= ~borderrel;
+                       } else
+                               tty_putc(tty, CELL_BORDERS[celltype]);
                }
        }
 
diff --git a/tmux.1 b/tmux.1
index 1eb02fe..c750acb 100644
--- a/tmux.1
+++ b/tmux.1
@@ -2341,6 +2341,11 @@ window.
 .Op Ic on | off
 .Xc
 If enabled, request mouse input as UTF-8 on UTF-8 terminals.
+.It Xo Ic pane-active-border-mark
+.Op Ic none | colorsplit | arrows
+.Xc
+Choose between two types of visual markers indicating the current pane, 
particularly useful with only two visible panes and their single shared border. 
Default is
+.Ic none .
 .It Ic pane-active-border-bg Ar colour
 .It Ic pane-active-border-fg Ar colour
 Set the pane border colour for the currently active pane.
diff --git a/tty-term.c b/tty-term.c
index a3292eb..74b7254 100644
--- a/tty-term.c
+++ b/tty-term.c
@@ -432,7 +432,7 @@ tty_term_find(char *name, int fd, const char *overrides, 
char **cause)
        if (tty_term_has(term, TTYC_ACSC))
                acs = tty_term_string(term, TTYC_ACSC);
        else
-               acs = "a#j+k+l+m+n+o-p-q-r-s-t+u+v+w+x|y<z>~.";
+               acs = "+>,<-^.va#j+k+l+m+n+o-p-q-r-s-t+u+v+w+x|y<z>~.";
        for (; acs[0] != '\0' && acs[1] != '\0'; acs += 2)
                term->acs[(u_char) acs[0]][0] = acs[1];
 
-- 
1.8.4


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to