summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cmd-choose-tree.c6
-rw-r--r--key-bindings.c8
-rw-r--r--mode-tree.c19
-rw-r--r--server-fn.c4
-rw-r--r--tmux.112
-rw-r--r--tmux.h1
-rw-r--r--window-buffer.c1
-rw-r--r--window-client.c1
-rw-r--r--window-tree.c1
9 files changed, 40 insertions, 13 deletions
diff --git a/cmd-choose-tree.c b/cmd-choose-tree.c
index 815c2a03..23914178 100644
--- a/cmd-choose-tree.c
+++ b/cmd-choose-tree.c
@@ -30,7 +30,7 @@ const struct cmd_entry cmd_choose_tree_entry = {
.name = "choose-tree",
.alias = NULL,
- .args = { "F:Gf:NO:st:w", 0, 1 },
+ .args = { "F:Gf:NO:st:wZ", 0, 1 },
.usage = "[-GNsw] [-F format] [-f filter] [-O sort-order] "
CMD_TARGET_PANE_USAGE,
@@ -44,7 +44,7 @@ const struct cmd_entry cmd_choose_client_entry = {
.name = "choose-client",
.alias = NULL,
- .args = { "F:f:NO:t:", 0, 1 },
+ .args = { "F:f:NO:t:Z", 0, 1 },
.usage = "[-N] [-F format] [-f filter] [-O sort-order] "
CMD_TARGET_PANE_USAGE,
@@ -58,7 +58,7 @@ const struct cmd_entry cmd_choose_buffer_entry = {
.name = "choose-buffer",
.alias = NULL,
- .args = { "F:f:NO:t:", 0, 1 },
+ .args = { "F:f:NO:t:Z", 0, 1 },
.usage = "[-N] [-F format] [-f filter] [-O sort-order] "
CMD_TARGET_PANE_USAGE,
diff --git a/key-bindings.c b/key-bindings.c
index a13c7977..83670d2d 100644
--- a/key-bindings.c
+++ b/key-bindings.c
@@ -183,9 +183,9 @@ key_bindings_init(void)
"bind 9 select-window -t:=9",
"bind : command-prompt",
"bind \\; last-pane",
- "bind = choose-buffer",
+ "bind = choose-buffer -Z",
"bind ? list-keys",
- "bind D choose-client",
+ "bind D choose-client -Z",
"bind E select-layout -E",
"bind L switch-client -l",
"bind M select-pane -M",
@@ -202,9 +202,9 @@ key_bindings_init(void)
"bind p previous-window",
"bind q display-panes",
"bind r refresh-client",
- "bind s choose-tree -s",
+ "bind s choose-tree -Zs",
"bind t clock-mode",
- "bind w choose-tree -w",
+ "bind w choose-tree -Zw",
"bind x confirm-before -p\"kill-pane #P? (y/n)\" kill-pane",
"bind z resize-pane -Z",
"bind { swap-pane -U",
diff --git a/mode-tree.c b/mode-tree.c
index cbef4f6a..05ec492d 100644
--- a/mode-tree.c
+++ b/mode-tree.c
@@ -31,6 +31,7 @@ TAILQ_HEAD(mode_tree_list, mode_tree_item);
struct mode_tree_data {
int dead;
u_int references;
+ int zoomed;
struct window_pane *wp;
void *modedata;
@@ -344,6 +345,19 @@ mode_tree_start(struct window_pane *wp, struct args *args,
}
void
+mode_tree_zoom(struct mode_tree_data *mtd, struct args *args)
+{
+ struct window_pane *wp = mtd->wp;
+
+ if (args_has(args, 'Z')) {
+ mtd->zoomed = (wp->window->flags & WINDOW_ZOOMED);
+ if (!mtd->zoomed && window_zoom(wp) == 0)
+ server_redraw_window(wp->window);
+ } else
+ mtd->zoomed = -1;
+}
+
+void
mode_tree_build(struct mode_tree_data *mtd)
{
struct screen *s = &mtd->screen;
@@ -394,6 +408,11 @@ mode_tree_remove_ref(struct mode_tree_data *mtd)
void
mode_tree_free(struct mode_tree_data *mtd)
{
+ struct window_pane *wp = mtd->wp;
+
+ if (mtd->zoomed == 0)
+ server_unzoom_window(wp->window);
+
mode_tree_free_items(&mtd->children);
mode_tree_clear_lines(mtd);
screen_free(&mtd->screen);
diff --git a/server-fn.c b/server-fn.c
index 713e85b7..ef96bf58 100644
--- a/server-fn.c
+++ b/server-fn.c
@@ -455,8 +455,6 @@ server_set_stdin_callback(struct client *c, void (*cb)(struct client *, int,
void
server_unzoom_window(struct window *w)
{
- if (window_unzoom(w) == 0) {
+ if (window_unzoom(w) == 0)
server_redraw_window(w);
- server_status_window(w);
- }
}
diff --git a/tmux.1 b/tmux.1
index 428c1016..3db23786 100644
--- a/tmux.1
+++ b/tmux.1
@@ -1377,7 +1377,7 @@ the end of the visible pane.
The default is to capture only the visible contents of the pane.
.It Xo
.Ic choose-client
-.Op Fl N
+.Op Fl NZ
.Op Fl F Ar format
.Op Fl f Ar filter
.Op Fl O Ar sort-order
@@ -1386,6 +1386,8 @@ The default is to capture only the visible contents of the pane.
.Xc
Put a pane into client mode, allowing a client to be selected interactively from
a list.
+.Fl Z
+zooms the pane.
The following keys may be used in client mode:
.Bl -column "Key" "Function" -offset indent
.It Sy "Key" Ta Sy "Function"
@@ -1436,7 +1438,7 @@ starts without the preview.
This command works only if at least one client is attached.
.It Xo
.Ic choose-tree
-.Op Fl GNsw
+.Op Fl GNswZ
.Op Fl F Ar format
.Op Fl f Ar filter
.Op Fl O Ar sort-order
@@ -1449,6 +1451,8 @@ interactively from a list.
starts with sessions collapsed and
.Fl w
with windows collapsed.
+.Fl Z
+zooms the pane.
The following keys may be used in tree mode:
.Bl -column "Key" "Function" -offset indent
.It Sy "Key" Ta Sy "Function"
@@ -4129,7 +4133,7 @@ The buffer commands are as follows:
.Bl -tag -width Ds
.It Xo
.Ic choose-buffer
-.Op Fl N
+.Op Fl NZ
.Op Fl F Ar format
.Op Fl f Ar filter
.Op Fl O Ar sort-order
@@ -4138,6 +4142,8 @@ The buffer commands are as follows:
.Xc
Put a pane into buffer mode, where a buffer may be chosen interactively from
a list.
+.Fl Z
+zooms the pane.
The following keys may be used in buffer mode:
.Bl -column "Key" "Function" -offset indent
.It Sy "Key" Ta Sy "Function"
diff --git a/tmux.h b/tmux.h
index 88a223e6..d7b9f334 100644
--- a/tmux.h
+++ b/tmux.h
@@ -2247,6 +2247,7 @@ void mode_tree_down(struct mode_tree_data *, int);
struct mode_tree_data *mode_tree_start(struct window_pane *, struct args *,
mode_tree_build_cb, mode_tree_draw_cb, mode_tree_search_cb,
void *, const char **, u_int, struct screen **);
+void mode_tree_zoom(struct mode_tree_data *, struct args *);
void mode_tree_build(struct mode_tree_data *);
void mode_tree_free(struct mode_tree_data *);
void mode_tree_resize(struct mode_tree_data *, u_int, u_int);
diff --git a/window-buffer.c b/window-buffer.c
index d416e39f..e0352be2 100644
--- a/window-buffer.c
+++ b/window-buffer.c
@@ -273,6 +273,7 @@ window_buffer_init(struct window_pane *wp, __unused struct cmd_find_state *fs,
data->data = mode_tree_start(wp, args, window_buffer_build,
window_buffer_draw, window_buffer_search, data,
window_buffer_sort_list, nitems(window_buffer_sort_list), &s);
+ mode_tree_zoom(data->data, args);
mode_tree_build(data->data);
mode_tree_draw(data->data);
diff --git a/window-client.c b/window-client.c
index aae9e0b4..69f99904 100644
--- a/window-client.c
+++ b/window-client.c
@@ -256,6 +256,7 @@ window_client_init(struct window_pane *wp, __unused struct cmd_find_state *fs,
data->data = mode_tree_start(wp, args, window_client_build,
window_client_draw, NULL, data, window_client_sort_list,
nitems(window_client_sort_list), &s);
+ mode_tree_zoom(data->data, args);
mode_tree_build(data->data);
mode_tree_draw(data->data);
diff --git a/window-tree.c b/window-tree.c
index 4165047b..8a327bb6 100644
--- a/window-tree.c
+++ b/window-tree.c
@@ -841,6 +841,7 @@ window_tree_init(struct window_pane *wp, struct cmd_find_state *fs,
data->data = mode_tree_start(wp, args, window_tree_build,
window_tree_draw, window_tree_search, data, window_tree_sort_list,
nitems(window_tree_sort_list), &s);
+ mode_tree_zoom(data->data, args);
mode_tree_build(data->data);
mode_tree_draw(data->data);