aboutsummaryrefslogtreecommitdiff
path: root/cmd-choose-buffer.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2014-05-13 21:58:48 +0100
committerThomas Adam <thomas@xteddy.org>2014-05-13 21:58:48 +0100
commitbae95844d75b257c61cd0ef57b1d826bdca09032 (patch)
treee2547df0ea03a6f686ac0cf7500bed3d00994ad2 /cmd-choose-buffer.c
parentea5a223a2e8901fa9afa991d147751d8a6789443 (diff)
parentb3e8d440ed0477e88232c3ba1779c67eafce3a48 (diff)
downloadrtmux-bae95844d75b257c61cd0ef57b1d826bdca09032.tar.gz
rtmux-bae95844d75b257c61cd0ef57b1d826bdca09032.tar.bz2
rtmux-bae95844d75b257c61cd0ef57b1d826bdca09032.zip
Merge branch 'obsd-master'
Conflicts: format.c window.c
Diffstat (limited to 'cmd-choose-buffer.c')
-rw-r--r--cmd-choose-buffer.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/cmd-choose-buffer.c b/cmd-choose-buffer.c
index 18d28345..6b146fad 100644
--- a/cmd-choose-buffer.c
+++ b/cmd-choose-buffer.c
@@ -75,19 +75,20 @@ cmd_choose_buffer_exec(struct cmd *self, struct cmd_q *cmdq)
action = xstrdup("paste-buffer -b '%%'");
idx = 0;
- while ((pb = paste_walk_stack(&idx)) != NULL) {
+ pb = NULL;
+ while ((pb = paste_walk(pb)) != NULL) {
cdata = window_choose_data_create(TREE_OTHER, c, c->session);
- cdata->idx = idx - 1;
+ cdata->idx = idx;
cdata->ft_template = xstrdup(template);
- format_add(cdata->ft, "line", "%u", idx - 1);
format_paste_buffer(cdata->ft, pb, utf8flag);
- xasprintf(&action_data, "%u", idx - 1);
+ xasprintf(&action_data, "%s", pb->name);
cdata->command = cmd_template_replace(action, action_data, 1);
free(action_data);
window_choose_add(wl->window->active, cdata);
+ idx++;
}
free(action);