summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/tmux.h
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/tmux.h
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/tmux.h')
-rw-r--r--usr.bin/tmux/tmux.h34
1 files changed, 22 insertions, 12 deletions
diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h
index a87dd304530..dfd2e6ba75f 100644
--- a/usr.bin/tmux/tmux.h
+++ b/usr.bin/tmux/tmux.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmux.h,v 1.854 2019/03/07 19:01:21 nicm Exp $ */
+/* $OpenBSD: tmux.h,v 1.855 2019/03/07 20:24:21 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -693,25 +693,37 @@ struct screen_write_ctx {
* Window mode. Windows can be in several modes and this is used to call the
* right function to handle input and output.
*/
+struct window_mode_entry;
struct window_mode {
const char *name;
- struct screen *(*init)(struct window_pane *, struct cmd_find_state *,
- struct args *);
- void (*free)(struct window_pane *);
- void (*resize)(struct window_pane *, u_int, u_int);
- void (*key)(struct window_pane *, struct client *,
+ struct screen *(*init)(struct window_mode_entry *,
+ struct cmd_find_state *, struct args *);
+ void (*free)(struct window_mode_entry *);
+ void (*resize)(struct window_mode_entry *, u_int, u_int);
+ void (*key)(struct window_mode_entry *, struct client *,
struct session *, struct winlink *, key_code,
struct mouse_event *);
- const char *(*key_table)(struct window_pane *);
- void (*command)(struct window_pane *, struct client *,
+ const char *(*key_table)(struct window_mode_entry *);
+ void (*command)(struct window_mode_entry *, struct client *,
struct session *, struct winlink *, struct args *,
struct mouse_event *);
- void (*formats)(struct window_pane *, struct format_tree *);
+ void (*formats)(struct window_mode_entry *,
+ struct format_tree *);
};
#define WINDOW_MODE_TIMEOUT 180
+/* Active window mode. */
+struct window_mode_entry {
+ struct window_pane *wp;
+
+ const struct window_mode *mode;
+ void *data;
+
+ u_int prefix;
+};
+
/* Child window structure. */
struct window_pane {
u_int id;
@@ -780,11 +792,9 @@ struct window_pane {
struct grid *saved_grid;
struct grid_cell saved_cell;
- const struct window_mode *mode;
- void *modedata;
+ struct window_mode_entry *mode;
struct event modetimer;
time_t modelast;
- u_int modeprefix;
char *searchstr;
TAILQ_ENTRY(window_pane) entry;