From 44299416689d09e6dc1c68230be50ab1bf5c88ad Mon Sep 17 00:00:00 2001 From: nicm Date: Sun, 9 Nov 2014 15:13:01 +0000 Subject: [PATCH 1/3] Expand formats in copy-pipe command, suggested by Suraj N Kurapati. --- window-copy.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/window-copy.c b/window-copy.c index 01b98241..f5973322 100644 --- a/window-copy.c +++ b/window-copy.c @@ -1479,18 +1479,28 @@ void window_copy_copy_pipe(struct window_pane *wp, struct session *sess, const char *bufname, const char *arg) { - void *buf; - size_t len; - struct job *job; - + void *buf; + size_t len; + struct job *job; + struct format_tree *ft; + char *expanded; buf = window_copy_get_selection(wp, &len); if (buf == NULL) return; - job = job_run(arg, sess, NULL, NULL, NULL); + ft = format_create(); + format_window_pane(ft, wp); + if (sess != NULL) + format_session(ft, sess); + expanded = format_expand(ft, arg); + + job = job_run(expanded, sess, NULL, NULL, NULL); bufferevent_write(job->event, buf, len); + free(expanded); + format_free(ft); + window_copy_copy_buffer(wp, bufname, buf, len); } From 7697f5aa8feb11967e09d4933c2b11f487b6a535 Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 10 Nov 2014 19:53:32 +0000 Subject: [PATCH 2/3] Revert r1.17 as it breaks inserting in some cases. --- grid-view.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grid-view.c b/grid-view.c index f96a2d9e..badabd56 100644 --- a/grid-view.c +++ b/grid-view.c @@ -184,7 +184,7 @@ grid_view_insert_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); - sx = grid_view_x(gd, gd->linedata[py].cellsize); + sx = grid_view_x(gd, gd->sx); if (px == sx - 1) grid_clear(gd, px, py, 1, 1); @@ -201,7 +201,7 @@ grid_view_delete_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); - sx = grid_view_x(gd, gd->linedata[py].cellsize); + sx = grid_view_x(gd, gd->sx); grid_move_cells(gd, px, px + nx, py, sx - px - nx); grid_clear(gd, sx - nx, py, px + nx - (sx - nx), 1); From f9308bc244bb568fb678effbbb08f8fb277e7560 Mon Sep 17 00:00:00 2001 From: nicm Date: Wed, 12 Nov 2014 16:00:03 +0000 Subject: [PATCH 3/3] Don't let force-width or force-height be < PANE_MINIMUM. --- resize.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resize.c b/resize.c index 70379420..73a728fa 100644 --- a/resize.c +++ b/resize.c @@ -117,10 +117,10 @@ recalculate_sizes(void) continue; limit = options_get_number(&w->options, "force-width"); - if (limit != 0 && ssx > limit) + if (limit >= PANE_MINIMUM && ssx > limit) ssx = limit; limit = options_get_number(&w->options, "force-height"); - if (limit != 0 && ssy > limit) + if (limit >= PANE_MINIMUM && ssy > limit) ssy = limit; if (w->sx == ssx && w->sy == ssy)