Whoops this time with the diff

Index: screen-redraw.c
===================================================================
RCS file: /cvs/src/usr.bin/tmux/screen-redraw.c,v
retrieving revision 1.21
diff -u -p -r1.21 screen-redraw.c
--- screen-redraw.c     29 Jan 2012 09:37:02 -0000      1.21
+++ screen-redraw.c     20 Mar 2012 14:56:05 -0000
@@ -42,6 +42,13 @@ void screen_redraw_draw_number(struct cl
 #define CELL_OUTSIDE 12
 
 #define CELL_BORDERS " xqlkmjwvtun~"
+#define CELL_MARKERS " +, .   -"
+
+#define BORDER_NONE 0
+#define BORDER_LEFT 1
+#define BORDER_RIGHT 2
+#define BORDER_TOP 4
+#define BORDER_BOTTOM 8
 
 /* Check if cell is on the border of a particular pane. */
 int
@@ -55,21 +62,21 @@ screen_redraw_cell_border1(struct window
        /* Left/right borders. */
        if ((wp->yoff == 0 || py >= wp->yoff - 1) && py <= wp->yoff + wp->sy) {
                if (wp->xoff != 0 && px == wp->xoff - 1)
-                       return (1);
+                       return (BORDER_LEFT);
                if (px == wp->xoff + wp->sx)
-                       return (1);
+                       return (BORDER_RIGHT);
        }
 
        /* Top/bottom borders. */
        if ((wp->xoff == 0 || px >= wp->xoff - 1) && px <= wp->xoff + wp->sx) {
                if (wp->yoff != 0 && py == wp->yoff - 1)
-                       return (1);
+                       return (BORDER_TOP);
                if (py == wp->yoff + wp->sy)
-                       return (1);
+                       return (BORDER_BOTTOM);
        }
 
        /* Outside pane. */
-       return (-1);
+       return (BORDER_NONE);
 }
 
 /* Check if a cell is on the pane border. */
@@ -78,14 +85,13 @@ screen_redraw_cell_border(struct client 
 {
        struct window           *w = c->session->curw->window;
        struct window_pane      *wp;
-       int                      retval;
 
        /* Check all the panes. */
        TAILQ_FOREACH(wp, &w->panes, entry) {
                if (!window_pane_visible(wp))
                        continue;
-               if ((retval = screen_redraw_cell_border1(wp, px, py)) != -1)
-                       return (retval);
+               if (screen_redraw_cell_border1(wp, px, py) != BORDER_NONE)
+                       return (1);
        }
 
        return (0);
@@ -175,7 +181,7 @@ screen_redraw_screen(struct client *c, i
        struct window_pane      *wp;
        struct grid_cell         active_gc, other_gc;
        u_int                    i, j, type, top;
-       int                      status, spos, fg, bg;
+       int                      status, spos, fg, bg, border, marks;
 
        /* Suspended clients should not be updated. */
        if (c->flags & CLIENT_SUSPENDED)
@@ -216,6 +222,7 @@ screen_redraw_screen(struct client *c, i
        colour_set_bg(&active_gc, bg);
 
        /* Draw background and borders. */
+       marks = 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)
@@ -227,12 +234,21 @@ screen_redraw_screen(struct client *c, i
                        type = screen_redraw_check_cell(c, i, j);
                        if (type == CELL_INSIDE)
                                continue;
-                       if (screen_redraw_cell_border1(w->active, i, j) == 1)
+                       border = screen_redraw_cell_border1(w->active, i, j);
+                       if (border != BORDER_NONE)
                                tty_attributes(tty, &active_gc);
                        else
                                tty_attributes(tty, &other_gc);
                        tty_cursor(tty, i, top + j);
-                       tty_putc(tty, CELL_BORDERS[type]);
+
+                       if (type == CELL_LEFTRIGHT || type == CELL_TOPBOTTOM)
+                               border = BORDER_NONE;
+                       if (border != BORDER_NONE &&
+                           (marks & border) && i > 0 && top + j > 0) {
+                               tty_putc(tty, CELL_MARKERS[border]);
+                               marks &= ~border;
+                       } else
+                               tty_putc(tty, CELL_BORDERS[type]);
                }
        }
 



On Tue, Mar 20, 2012 at 02:57:15PM +0000, Nicholas Marriott wrote:
> Here's tweaked version of your border marks diff.
> 
> However, I'd be interested to know what ACS , . + - show on your
> terminal because here they just show themselves which looks a bit
> silly. What are you expecting to appear?
> 
> 
> On Sat, Mar 17, 2012 at 04:22:25PM +0100, marcel partap wrote:
> > Hi there fellow h4x0rz ;)
> > just wanted to have a comment on these, will finalize them after my exam
> > end of the month...
> > 
> > tmux-quiet-set-option.patch:
> > still useful, my use case is setting option window-status-fg when
> > splitting a window with su -l [different user]
> > 
> > tmux-recalculate-window-size-on-mouse-select-window.patch:
> > without this windows resize only by keyboard traversal (=>
> > cmd_select_window_exec()).
> > Should recalculate_sizes() not really go into server_redraw_session() ?
> > 
> > tmux-border-mark-active-pane-v2.patch:
> > Wanted to have this since long time, please comment on its implementation..
> > renamed screen_redraw_cell_border[1]() to
> > screen_redraw_cell_is_border[_of_wp]() for clarity. Still needs option -
> > "pane-active-indicator"?
> > 
> > tmux-mouse-wheel-scrolling.patch:
> > After the recent changes the mouse handling so my implementation of a
> > mouse event queue that can be used for status-line click gestures like
> > 'ctrl+alt+middle click twice within 400ms to kill window' is postponed
> > for some more. However, this is split off for added pwnage :D
> > It emulates mouse scrolling for non-mouse-aware term apps by sending
> > cursor-up/down input, like in some other terminal emulators like KDE's
> > konsole.
> > SHIFT+Scroll scrolls single lines, CTRL+Scroll triples scroll speed.
> > Works well with less, bash history..
> > MOUSE_SCROLL_LINES will be made into a user option in next patch iteration.
> > 
> > tmux-exit-mouse-copy-mode-less-aggressively-and-adv-wheel-scroll-v3.patch:
> > For mode-mouse=copy-mode, do not exit copy-mode when scrolling to the
> > bottom or click-selecting pane in copy mode. Also has the SHIFT/CTRL
> > scroll modifier stuff from above patch in it.
> > 
> > ok that's it for now, happy hacking and thx everyone for their
> > contributions of my favorite desktop app ;)
> > #regards|marcel
> 
> 
> 
> 
> 
> 
> > ------------------------------------------------------------------------------
> > This SF email is sponsosred by:
> > Try Windows Azure free for 90 days Click Here 
> > http://p.sf.net/sfu/sfd2d-msazure
> 
> > _______________________________________________
> > tmux-users mailing list
> > tmux-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/tmux-users
> 

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to