diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2019-05-28 07:18:43 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2019-05-28 07:18:43 +0000 |
commit | e24280f07a09b142cec6c35affbda616b270073a (patch) | |
tree | 838c2d531cbd21934216d31bc62675be0d06e8c3 /usr.bin/tmux/window-buffer.c | |
parent | da4818b66eb44a1b7d0f1f5b2171d8e61b0d068d (diff) |
Change display-menu from taking a single string to a set of arguments,
which is much easier to work with. Based on a diff from Avi Halachmi.
Diffstat (limited to 'usr.bin/tmux/window-buffer.c')
-rw-r--r-- | usr.bin/tmux/window-buffer.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/usr.bin/tmux/window-buffer.c b/usr.bin/tmux/window-buffer.c index 63347f07b93..46e6e4f9f88 100644 --- a/usr.bin/tmux/window-buffer.c +++ b/usr.bin/tmux/window-buffer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: window-buffer.c,v 1.19 2019/05/12 08:58:09 nicm Exp $ */ +/* $OpenBSD: window-buffer.c,v 1.20 2019/05/28 07:18:42 nicm Exp $ */ /* * Copyright (c) 2017 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -39,18 +39,21 @@ static void window_buffer_key(struct window_mode_entry *, #define WINDOW_BUFFER_DEFAULT_FORMAT \ "#{buffer_size} bytes (#{t:buffer_created})" -#define WINDOW_BUFFER_MENU \ - "Paste,p,|" \ - "Paste Tagged,P,|" \ - "|" \ - "Tag,t,|" \ - "Tag All,C-t,|" \ - "Tag None,T,|" \ - "|" \ - "Delete,d,|" \ - "Delete Tagged,D,|" \ - "|" \ - "Cancel,q," +static const struct menu_item window_buffer_menu_items[] = { + { "Paste", 'p', NULL }, + { "Paste Tagged", 'P', NULL }, + { "", KEYC_NONE, NULL }, + { "Tag", 't', NULL }, + { "Tag All", '\024', NULL }, + { "Tag None", 'T', NULL }, + { "", KEYC_NONE, NULL }, + { "Delete", 'd', NULL }, + { "Delete Tagged", 'D', NULL }, + { "", KEYC_NONE, NULL }, + { "Cancel", 'q', NULL }, + + { NULL, KEYC_NONE, NULL } +}; const struct window_mode window_buffer_mode = { .name = "buffer-mode", @@ -315,7 +318,7 @@ window_buffer_init(struct window_mode_entry *wme, struct cmd_find_state *fs, data->data = mode_tree_start(wp, args, window_buffer_build, window_buffer_draw, window_buffer_search, window_buffer_menu, data, - WINDOW_BUFFER_MENU, window_buffer_sort_list, + window_buffer_menu_items, window_buffer_sort_list, nitems(window_buffer_sort_list), &s); mode_tree_zoom(data->data, args); |