aboutsummaryrefslogtreecommitdiff
path: root/window-tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'window-tree.c')
-rw-r--r--window-tree.c34
1 files changed, 26 insertions, 8 deletions
diff --git a/window-tree.c b/window-tree.c
index 009e93c6..d245a715 100644
--- a/window-tree.c
+++ b/window-tree.c
@@ -37,12 +37,14 @@ static void window_tree_key(struct window_mode_entry *,
#define WINDOW_TREE_DEFAULT_FORMAT \
"#{?pane_format," \
- "#{pane_current_command} \"#{pane_title}\"" \
+ "#{?pane_marked,#[reverse],}" \
+ "#{pane_current_command}#{?pane_active,*,}#{?pane_marked,M,}" \
+ "#{?#{&&:#{pane_title},#{!=:#{pane_title},#{host_short}}},: \"#{pane_title}\",}" \
"," \
"#{?window_format," \
- "#{window_name}#{window_flags} " \
- "(#{window_panes} panes)" \
- "#{?#{==:#{window_panes},1}, \"#{pane_title}\",}" \
+ "#{?window_marked_flag,#[reverse],}" \
+ "#{window_name}#{window_flags}" \
+ "#{?#{&&:#{==:#{window_panes},1},#{&&:#{pane_title},#{!=:#{pane_title},#{host_short}}}},: \"#{pane_title}\",}" \
"," \
"#{session_windows} windows" \
"#{?session_grouped, " \
@@ -54,8 +56,9 @@ static void window_tree_key(struct window_mode_entry *,
"}"
static const struct menu_item window_tree_menu_items[] = {
- { "Select", 'E', NULL },
- { "Expand", 'R', NULL },
+ { "Select", '\r', NULL },
+ { "Expand", KEYC_RIGHT, NULL },
+ { "Mark", 'm', NULL },
{ "", KEYC_NONE, NULL },
{ "Tag", 't', NULL },
{ "Tag All", '\024', NULL },
@@ -833,7 +836,7 @@ window_tree_search(__unused void *modedata, void *itemdata, const char *ss)
return (0);
retval = (strstr(cmd, ss) != NULL);
free(cmd);
- return retval;
+ return (retval);
}
return (0);
}
@@ -1170,7 +1173,7 @@ window_tree_key(struct window_mode_entry *wme, struct client *c,
struct window_tree_modedata *data = wme->data;
struct window_tree_itemdata *item, *new_item;
char *name, *prompt = NULL;
- struct cmd_find_state fs;
+ struct cmd_find_state fs, *fsp = &data->fs;
int finished;
u_int tagged, x, y, idx;
struct session *ns;
@@ -1192,6 +1195,21 @@ window_tree_key(struct window_mode_entry *wme, struct client *c,
case '>':
data->offset++;
break;
+ case 'H':
+ mode_tree_expand(data->data, (uint64_t)fsp->s);
+ mode_tree_expand(data->data, (uint64_t)fsp->wl);
+ if (!mode_tree_set_current(data->data, (uint64_t)wme->wp))
+ mode_tree_set_current(data->data, (uint64_t)fsp->wl);
+ break;
+ case 'm':
+ window_tree_pull_item(item, &ns, &nwl, &nwp);
+ server_set_marked(ns, nwl, nwp);
+ mode_tree_build(data->data);
+ break;
+ case 'M':
+ server_clear_marked();
+ mode_tree_build(data->data);
+ break;
case 'x':
window_tree_pull_item(item, &ns, &nwl, &nwp);
switch (item->type) {