summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/window-buffer.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2019-03-07 20:24:22 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2019-03-07 20:24:22 +0000
commit12025284b527222c5f437e0a617b7b505c6fb3cb (patch)
tree27773c80386768e1f7a2192b4aa8cd926debc09e /usr.bin/tmux/window-buffer.c
parent2c99347e69e9d4204d01c39c2491d19f5ecc8b3f (diff)
Add a separate mode struct for the active window mode if any.
Diffstat (limited to 'usr.bin/tmux/window-buffer.c')
-rw-r--r--usr.bin/tmux/window-buffer.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/usr.bin/tmux/window-buffer.c b/usr.bin/tmux/window-buffer.c
index 723adab3aee..ad571e47177 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.14 2018/12/18 13:20:44 nicm Exp $ */
+/* $OpenBSD: window-buffer.c,v 1.15 2019/03/07 20:24:21 nicm Exp $ */
/*
* Copyright (c) 2017 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -25,12 +25,12 @@
#include "tmux.h"
-static struct screen *window_buffer_init(struct window_pane *,
+static struct screen *window_buffer_init(struct window_mode_entry *,
struct cmd_find_state *, struct args *);
-static void window_buffer_free(struct window_pane *);
-static void window_buffer_resize(struct window_pane *, u_int,
+static void window_buffer_free(struct window_mode_entry *);
+static void window_buffer_resize(struct window_mode_entry *, u_int,
u_int);
-static void window_buffer_key(struct window_pane *,
+static void window_buffer_key(struct window_mode_entry *,
struct client *, struct session *,
struct winlink *, key_code, struct mouse_event *);
@@ -253,13 +253,14 @@ window_buffer_search(__unused void *modedata, void *itemdata, const char *ss)
}
static struct screen *
-window_buffer_init(struct window_pane *wp, __unused struct cmd_find_state *fs,
- struct args *args)
+window_buffer_init(struct window_mode_entry *wme,
+ __unused struct cmd_find_state *fs, struct args *args)
{
+ struct window_pane *wp = wme->wp;
struct window_buffer_modedata *data;
struct screen *s;
- wp->modedata = data = xcalloc(1, sizeof *data);
+ wme->data = data = xcalloc(1, sizeof *data);
if (args == NULL || !args_has(args, 'F'))
data->format = xstrdup(WINDOW_BUFFER_DEFAULT_FORMAT);
@@ -282,9 +283,9 @@ window_buffer_init(struct window_pane *wp, __unused struct cmd_find_state *fs,
}
static void
-window_buffer_free(struct window_pane *wp)
+window_buffer_free(struct window_mode_entry *wme)
{
- struct window_buffer_modedata *data = wp->modedata;
+ struct window_buffer_modedata *data = wme->data;
u_int i;
if (data == NULL)
@@ -303,9 +304,9 @@ window_buffer_free(struct window_pane *wp)
}
static void
-window_buffer_resize(struct window_pane *wp, u_int sx, u_int sy)
+window_buffer_resize(struct window_mode_entry *wme, u_int sx, u_int sy)
{
- struct window_buffer_modedata *data = wp->modedata;
+ struct window_buffer_modedata *data = wme->data;
mode_tree_resize(data->data, sx, sy);
}
@@ -337,11 +338,12 @@ window_buffer_do_paste(void* modedata, void *itemdata, struct client *c,
}
static void
-window_buffer_key(struct window_pane *wp, struct client *c,
+window_buffer_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_buffer_modedata *data = wp->modedata;
+ struct window_pane *wp = wme->wp;
+ struct window_buffer_modedata *data = wme->data;
struct mode_tree_data *mtd = data->data;
struct window_buffer_itemdata *item;
int finished;