diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2014-05-13 07:34:36 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2014-05-13 07:34:36 +0000 |
commit | eea58c09685cd8439bb19a2e328aa366de27f75a (patch) | |
tree | 9cb6bc45f5903458267efca5355da3c61d0c7e99 /usr.bin/tmux/cmd-list-buffers.c | |
parent | ad8189fb5b6fc3356176d1de4ace98c13dcf4f97 (diff) |
Add support for named buffers. If you don't name a buffer, things work
much as before - buffers are automatically named "buffer0000",
"buffer0001" and so on and ordered as a stack. Buffers can be named
explicitly when creating ("loadb -b foo" etc) or renamed ("setb -b
buffer0000 -n foo"). If buffers are named explicitly, they are not
deleted when buffer-limit is reached. Diff from J Raynor.
Diffstat (limited to 'usr.bin/tmux/cmd-list-buffers.c')
-rw-r--r-- | usr.bin/tmux/cmd-list-buffers.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/usr.bin/tmux/cmd-list-buffers.c b/usr.bin/tmux/cmd-list-buffers.c index dc86bc7f1b3..a43e32b51ba 100644 --- a/usr.bin/tmux/cmd-list-buffers.c +++ b/usr.bin/tmux/cmd-list-buffers.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-list-buffers.c,v 1.20 2014/04/24 09:14:43 nicm Exp $ */ +/* $OpenBSD: cmd-list-buffers.c,v 1.21 2014/05/13 07:34:35 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -44,17 +44,15 @@ cmd_list_buffers_exec(unused struct cmd *self, struct cmd_q *cmdq) struct args *args = self->args; struct paste_buffer *pb; struct format_tree *ft; - u_int idx; char *line; const char *template; if ((template = args_get(args, 'F')) == NULL) template = LIST_BUFFERS_TEMPLATE; - idx = 0; - while ((pb = paste_walk_stack(&idx)) != NULL) { + pb = NULL; + while ((pb = paste_walk(pb)) != NULL) { ft = format_create(); - format_add(ft, "line", "%u", idx - 1); format_paste_buffer(ft, pb, 0); line = format_expand(ft, template); |