aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2017-04-21 20:01:18 +0100
committerThomas Adam <thomas@xteddy.org>2017-04-21 20:01:18 +0100
commit1f209ed030f9879d873d10341171889af08ae070 (patch)
tree5729e3f2f1e423310eaf19a5fe3a54b5756533bb
parentc376c5a817973f176894c7ee11bb5675affb3be4 (diff)
parent3c876235cc2d0d36f961e1f026f9feaf5cd22b73 (diff)
downloadrtmux-1f209ed030f9879d873d10341171889af08ae070.tar.gz
rtmux-1f209ed030f9879d873d10341171889af08ae070.tar.bz2
rtmux-1f209ed030f9879d873d10341171889af08ae070.zip
Merge branch 'obsd-master'
-rw-r--r--cmd-find.c22
-rw-r--r--cmd-queue.c5
-rw-r--r--cmd-split-window.c7
-rw-r--r--server-client.c6
-rw-r--r--tmux.h7
5 files changed, 26 insertions, 21 deletions
diff --git a/cmd-find.c b/cmd-find.c
index 1261156d..d21b3d7e 100644
--- a/cmd-find.c
+++ b/cmd-find.c
@@ -878,7 +878,7 @@ cmd_find_log_state(const char *prefix, struct cmd_find_state *fs)
}
/* Find state from a session. */
-int
+void
cmd_find_from_session(struct cmd_find_state *fs, struct session *s)
{
cmd_find_clear_state(fs, NULL, 0);
@@ -889,11 +889,10 @@ cmd_find_from_session(struct cmd_find_state *fs, struct session *s)
fs->wp = fs->w->active;
cmd_find_log_state(__func__, fs);
- return (0);
}
/* Find state from a winlink. */
-int
+void
cmd_find_from_winlink(struct cmd_find_state *fs, struct winlink *wl)
{
cmd_find_clear_state(fs, NULL, 0);
@@ -904,7 +903,6 @@ cmd_find_from_winlink(struct cmd_find_state *fs, struct winlink *wl)
fs->wp = wl->window->active;
cmd_find_log_state(__func__, fs);
- return (0);
}
/* Find state from a session and window. */
@@ -941,6 +939,22 @@ cmd_find_from_window(struct cmd_find_state *fs, struct window *w)
return (0);
}
+/* Find state from a winlink and pane. */
+void
+cmd_find_from_winlink_pane(struct cmd_find_state *fs, struct winlink *wl,
+ struct window_pane *wp)
+{
+ cmd_find_clear_state(fs, NULL, 0);
+
+ fs->s = wl->session;
+ fs->wl = wl;
+ fs->idx = fs->wl->idx;
+ fs->w = fs->wl->window;
+ fs->wp = wp;
+
+ cmd_find_log_state(__func__, fs);
+}
+
/* Find state from a pane. */
int
cmd_find_from_pane(struct cmd_find_state *fs, struct window_pane *wp)
diff --git a/cmd-queue.c b/cmd-queue.c
index 56745c38..804216fa 100644
--- a/cmd-queue.c
+++ b/cmd-queue.c
@@ -206,7 +206,7 @@ cmdq_fire_command(struct cmdq_item *item)
goto out;
}
if (item->client == NULL)
- item->client = cmd_find_client(item, NULL, CMD_FIND_QUIET);
+ item->client = cmd_find_client(item, NULL, 1);
retval = cmd->entry->exec(cmd, item);
if (retval == CMD_RETURN_ERROR)
@@ -325,8 +325,7 @@ cmdq_next(struct client *c)
item->time = time(NULL);
item->number = ++number;
- switch (item->type)
- {
+ switch (item->type) {
case CMDQ_COMMAND:
retval = cmdq_fire_command(item);
diff --git a/cmd-split-window.c b/cmd-split-window.c
index 7724b9ab..38b1f937 100644
--- a/cmd-split-window.c
+++ b/cmd-split-window.c
@@ -171,12 +171,7 @@ cmd_split_window_exec(struct cmd *self, struct cmdq_item *item)
if (to_free != NULL)
free((void *)to_free);
- cmd_find_clear_state(&fs, NULL, 0);
- fs.s = s;
- fs.wl = wl;
- fs.w = w;
- fs.wp = new_wp;
- cmd_find_log_state(__func__, &fs);
+ cmd_find_from_winlink_pane(&fs, wl, new_wp);
hooks_insert(s->hooks, item, &fs, "after-split-window");
return (CMD_RETURN_NORMAL);
diff --git a/server-client.c b/server-client.c
index d0a67f23..9737d8d3 100644
--- a/server-client.c
+++ b/server-client.c
@@ -944,11 +944,7 @@ retry:
/* Find default state if the pane is known. */
if (KEYC_IS_MOUSE(key) && m->valid && wp != NULL) {
- cmd_find_clear_state(&fs, NULL, 0);
- fs.s = s;
- fs.wl = fs.s->curw;
- fs.w = fs.wl->window;
- fs.wp = wp;
+ cmd_find_from_winlink_pane(&fs, s->curw, wp);
cmd_find_log_state(__func__, &fs);
if (!cmd_find_valid_state(&fs))
diff --git a/tmux.h b/tmux.h
index be9e7c9e..5f665f8a 100644
--- a/tmux.h
+++ b/tmux.h
@@ -43,7 +43,6 @@ extern char **environ;
struct args;
struct client;
struct cmdq_item;
-struct cmdq_subitem;
struct cmdq_list;
struct environ;
struct input_ctx;
@@ -1748,15 +1747,17 @@ int cmd_find_valid_state(struct cmd_find_state *);
void cmd_find_copy_state(struct cmd_find_state *,
struct cmd_find_state *);
void cmd_find_log_state(const char *, struct cmd_find_state *);
-int cmd_find_from_session(struct cmd_find_state *,
+void cmd_find_from_session(struct cmd_find_state *,
struct session *);
-int cmd_find_from_winlink(struct cmd_find_state *,
+void cmd_find_from_winlink(struct cmd_find_state *,
struct winlink *);
int cmd_find_from_session_window(struct cmd_find_state *,
struct session *, struct window *);
int cmd_find_from_window(struct cmd_find_state *, struct window *);
int cmd_find_from_pane(struct cmd_find_state *,
struct window_pane *);
+void cmd_find_from_winlink_pane(struct cmd_find_state *,
+ struct winlink *, struct window_pane *);
/* cmd.c */
int cmd_pack_argv(int, char **, char *, size_t);