summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--grid-view.c4
-rw-r--r--resize.c4
-rw-r--r--window-copy.c20
3 files changed, 19 insertions, 9 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);
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)
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);
}