The branch, master has been updated
       via  aaeee34c3250892c8a20e9c95efe66c1d0ec4be2 (commit)
       via  70397e4a957eefc2808c600214d8f7689caead71 (commit)
       via  43d904dbf396f5ce90e29915b416fd26e32c6c3e (commit)
      from  1da64bf786d2f139b822bc80ef6043443c0ea720 (commit)

- Log -----------------------------------------------------------------
commit aaeee34c3250892c8a20e9c95efe66c1d0ec4be2
Author: Nicholas Marriott <[email protected]>
Commit: Nicholas Marriott <[email protected]>

    Preserve trailing spaces with capture-pane -J, from George Nachman.
---
 cmd-capture-pane.c |    2 +-
 grid-view.c        |    2 +-
 grid.c             |    8 +++++---
 tmux.1             |    2 +-
 tmux.h             |    2 +-
 5 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/cmd-capture-pane.c b/cmd-capture-pane.c
index 118bf94..e925138 100644
--- a/cmd-capture-pane.c
+++ b/cmd-capture-pane.c
@@ -111,7 +111,7 @@ cmd_capture_pane_exec(struct cmd *self, struct cmd_q *cmdq)
                gc = NULL;
                for (i = top; i <= bottom; i++) {
                        line = grid_string_cells(gd, 0, i, sx, &gc, with_codes,
-                           escape_c0);
+                           escape_c0, !join_lines);
                        linelen = strlen(line);
 
                        buf = xrealloc(buf, 1, len + linelen + 1);
diff --git a/grid-view.c b/grid-view.c
index 3c5a872..7ef443a 100644
--- a/grid-view.c
+++ b/grid-view.c
@@ -234,5 +234,5 @@ grid_view_string_cells(struct grid *gd, u_int px, u_int py, 
u_int nx)
        px = grid_view_x(gd, px);
        py = grid_view_y(gd, py);
 
-       return (grid_string_cells(gd, px, py, nx, NULL, 0, 0));
+       return (grid_string_cells(gd, px, py, nx, NULL, 0, 0, 0));
 }
diff --git a/grid.c b/grid.c
index 1624b2d..b30127f 100644
--- a/grid.c
+++ b/grid.c
@@ -583,7 +583,7 @@ grid_string_cells_code(const struct grid_cell *lastgc,
 /* Convert cells into a string. */
 char *
 grid_string_cells(struct grid *gd, u_int px, u_int py, u_int nx,
-    struct grid_cell **lastgc, int with_codes, int escape_c0)
+    struct grid_cell **lastgc, int with_codes, int escape_c0, int trim)
 {
        const struct grid_cell  *gc;
        static struct grid_cell  lastgc1;
@@ -638,8 +638,10 @@ grid_string_cells(struct grid *gd, u_int px, u_int py, 
u_int nx,
                off += size;
        }
 
-       while (off > 0 && buf[off - 1] == ' ')
-               off--;
+        if (trim) {
+               while (off > 0 && buf[off - 1] == ' ')
+                       off--;
+        }
        buf[off] = '\0';
 
        return (buf);
diff --git a/tmux.1 b/tmux.1
index a094d58..a65ce22 100644
--- a/tmux.1
+++ b/tmux.1
@@ -1092,7 +1092,7 @@ attributes.
 .Fl C
 also escapes non-printable characters as octal \\xxx.
 .Fl J
-joins wrapped lines.
+joins wrapped lines and preserves trailing spaces at each line's end.
 .Pp
 .Fl S
 and
diff --git a/tmux.h b/tmux.h
index 0df1f4d..c1ad662 100644
--- a/tmux.h
+++ b/tmux.h
@@ -2002,7 +2002,7 @@ void       grid_clear_lines(struct grid *, u_int, u_int);
 void    grid_move_lines(struct grid *, u_int, u_int, u_int);
 void    grid_move_cells(struct grid *, u_int, u_int, u_int, u_int);
 char   *grid_string_cells(struct grid *, u_int, u_int, u_int,
-            struct grid_cell **, int, int);
+            struct grid_cell **, int, int, int);
 void    grid_duplicate_lines(
             struct grid *, u_int, struct grid *, u_int, u_int);
 u_int   grid_reflow(struct grid *, struct grid *, u_int);


commit 70397e4a957eefc2808c600214d8f7689caead71
Author: Nicholas Marriott <[email protected]>
Commit: Nicholas Marriott <[email protected]>

    Print %%error not %%end guard on error, from George Nachman.
---
 cmd-queue.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/cmd-queue.c b/cmd-queue.c
index 054c532..e5c8413 100644
--- a/cmd-queue.c
+++ b/cmd-queue.c
@@ -207,8 +207,12 @@ cmdq_continue(struct cmd_q *cmdq)
                        if (guards)
                                cmdq_print(cmdq, "%%begin");
                        retval = cmdq->cmd->entry->exec(cmdq->cmd, cmdq);
-                       if (guards)
-                               cmdq_print(cmdq, "%%end");
+                       if (guards) {
+                               if (retval == CMD_RETURN_ERROR)
+                                       cmdq_print(cmdq, "%%error");
+                               else
+                                       cmdq_print(cmdq, "%%end");
+                       }
 
                        if (retval == CMD_RETURN_ERROR)
                                break;


commit 43d904dbf396f5ce90e29915b416fd26e32c6c3e
Author: Nicholas Marriott <[email protected]>
Commit: Nicholas Marriott <[email protected]>

    tty.path can be NULL, don't dereference it. From George Nachman.
---
 cmd-choose-client.c |    2 +-
 cmd.c               |    8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/cmd-choose-client.c b/cmd-choose-client.c
index ce569ff..40752a7 100644
--- a/cmd-choose-client.c
+++ b/cmd-choose-client.c
@@ -79,7 +79,7 @@ cmd_choose_client_exec(struct cmd *self, struct cmd_q *cmdq)
        cur = idx = 0;
        for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
                c1 = ARRAY_ITEM(&clients, i);
-               if (c1 == NULL || c1->session == NULL)
+               if (c1 == NULL || c1->session == NULL || c1->tty.path == NULL)
                        continue;
                if (c1 == cmdq->client)
                        cur = idx;
diff --git a/cmd.c b/cmd.c
index f3326df..0d6a85f 100644
--- a/cmd.c
+++ b/cmd.c
@@ -326,9 +326,9 @@ cmd_current_session(struct cmd_q *cmdq, int 
prefer_unattached)
                return (c->session);
 
        /*
-        * If the name of the calling client's pty is know, build a list of the
-        * sessions that contain it and if any choose either the first or the
-        * newest.
+        * If the name of the calling client's pty is known, build a list of
+        * the sessions that contain it and if any choose either the first or
+        * the newest.
         */
        path = c == NULL ? NULL : c->tty.path;
        if (path != NULL) {
@@ -531,7 +531,7 @@ cmd_lookup_client(const char *name)
 
        for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
                c = ARRAY_ITEM(&clients, i);
-               if (c == NULL || c->session == NULL)
+               if (c == NULL || c->session == NULL || c->tty.path == NULL)
                        continue;
                path = c->tty.path;
 


-----------------------------------------------------------------------

Summary of changes:
 cmd-capture-pane.c  |    2 +-
 cmd-choose-client.c |    2 +-
 cmd-queue.c         |    8 ++++++--
 cmd.c               |    8 ++++----
 grid-view.c         |    2 +-
 grid.c              |    8 +++++---
 tmux.1              |    2 +-
 tmux.h              |    2 +-
 8 files changed, 20 insertions(+), 14 deletions(-)


hooks/post-receive
-- 
tmux

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
tmux-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tmux-cvs

Reply via email to