Switch all of the various choose- and list- commands over to the format

infrastructure, from Thomas Adam.
This commit is contained in:
Nicholas Marriott
2012-05-22 11:35:37 +00:00
parent 682884edc5
commit ebf94bc9cb
16 changed files with 211 additions and 112 deletions

View File

@ -349,6 +349,7 @@ format_winlink(struct format_tree *ft, struct session *s, struct winlink *wl)
format_add(ft, "window_flags", "%s", flags);
format_add(ft, "window_layout", "%s", layout);
format_add(ft, "window_active", "%d", wl == s->curw);
format_add(ft, "window_panes", "%u", window_count_panes(w));
xfree(flags);
xfree(layout);
@ -393,3 +394,14 @@ format_window_pane(struct format_tree *ft, struct window_pane *wp)
format_add(ft, "pane_pid", "%ld", (long) wp->pid);
format_add(ft, "pane_tty", "%s", wp->tty);
}
void
format_paste_buffer(struct format_tree *ft, struct paste_buffer *pb)
{
char *pb_print = paste_print(pb, 50);
format_add(ft, "buffer_size", "%zu", pb->size);
format_add(ft, "buffer_sample", "%s", pb_print);
xfree(pb_print);
}