summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/window-tree.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2019-03-07 20:24:21 +0000
committernicm <nicm@openbsd.org>2019-03-07 20:24:21 +0000
commit30a94f4585db9f50fb6a1c23caadbbef26c4afb1 (patch)
tree5acdc4f9378c915db3f7695fec401a063aec6e0a /usr.bin/tmux/window-tree.c
parentTidy changing the mode into window_copy_init_for_output. (diff)
downloadwireguard-openbsd-30a94f4585db9f50fb6a1c23caadbbef26c4afb1.tar.xz
wireguard-openbsd-30a94f4585db9f50fb6a1c23caadbbef26c4afb1.zip
Add a separate mode struct for the active window mode if any.
Diffstat (limited to 'usr.bin/tmux/window-tree.c')
-rw-r--r--usr.bin/tmux/window-tree.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/usr.bin/tmux/window-tree.c b/usr.bin/tmux/window-tree.c
index bfde4e68371..a3bbc0eaf47 100644
--- a/usr.bin/tmux/window-tree.c
+++ b/usr.bin/tmux/window-tree.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: window-tree.c,v 1.32 2018/12/18 13:20:44 nicm Exp $ */
+/* $OpenBSD: window-tree.c,v 1.33 2019/03/07 20:24:21 nicm Exp $ */
/*
* Copyright (c) 2017 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -24,11 +24,12 @@
#include "tmux.h"
-static struct screen *window_tree_init(struct window_pane *,
+static struct screen *window_tree_init(struct window_mode_entry *,
struct cmd_find_state *, struct args *);
-static void window_tree_free(struct window_pane *);
-static void window_tree_resize(struct window_pane *, u_int, u_int);
-static void window_tree_key(struct window_pane *,
+static void window_tree_free(struct window_mode_entry *);
+static void window_tree_resize(struct window_mode_entry *, u_int,
+ u_int);
+static void window_tree_key(struct window_mode_entry *,
struct client *, struct session *,
struct winlink *, key_code, struct mouse_event *);
@@ -810,13 +811,14 @@ window_tree_search(__unused void *modedata, void *itemdata, const char *ss)
}
static struct screen *
-window_tree_init(struct window_pane *wp, struct cmd_find_state *fs,
+window_tree_init(struct window_mode_entry *wme, struct cmd_find_state *fs,
struct args *args)
{
+ struct window_pane *wp = wme->wp;
struct window_tree_modedata *data;
struct screen *s;
- wp->modedata = data = xcalloc(1, sizeof *data);
+ wme->data = data = xcalloc(1, sizeof *data);
if (args_has(args, 's'))
data->type = WINDOW_TREE_SESSION;
@@ -871,9 +873,9 @@ window_tree_destroy(struct window_tree_modedata *data)
}
static void
-window_tree_free(struct window_pane *wp)
+window_tree_free(struct window_mode_entry *wme)
{
- struct window_tree_modedata *data = wp->modedata;
+ struct window_tree_modedata *data = wme->data;
if (data == NULL)
return;
@@ -884,9 +886,9 @@ window_tree_free(struct window_pane *wp)
}
static void
-window_tree_resize(struct window_pane *wp, u_int sx, u_int sy)
+window_tree_resize(struct window_mode_entry *wme, u_int sx, u_int sy)
{
- struct window_tree_modedata *data = wp->modedata;
+ struct window_tree_modedata *data = wme->data;
mode_tree_resize(data->data, sx, sy);
}
@@ -1119,11 +1121,12 @@ window_tree_mouse(struct window_tree_modedata *data, key_code key, u_int x,
}
static void
-window_tree_key(struct window_pane *wp, struct client *c,
+window_tree_key(struct window_mode_entry *wme, struct client *c,
__unused struct session *s, __unused struct winlink *wl, key_code key,
struct mouse_event *m)
{
- struct window_tree_modedata *data = wp->modedata;
+ struct window_pane *wp = wme->wp;
+ struct window_tree_modedata *data = wme->data;
struct window_tree_itemdata *item, *new_item;
char *name, *prompt = NULL;
struct cmd_find_state fs;