summaryrefslogtreecommitdiffstats
path: root/cmd-find.c
diff options
context:
space:
mode:
authornicm <nicm>2017-04-21 17:22:20 +0000
committernicm <nicm>2017-04-21 17:22:20 +0000
commitafa4e3ed9c9928c20b8007634538649422f920b5 (patch)
treecd905b6164983d67973890c8f49a3d34bc08eee6 /cmd-find.c
parent92a77e7654286a8aa4734b36f74ea49f9494311b (diff)
Add cmd_find_from_winlink_pane and use it in a couple of places, and
make functions that can't fail void.
Diffstat (limited to 'cmd-find.c')
-rw-r--r--cmd-find.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/cmd-find.c b/cmd-find.c
index 68c15f15..ea8c1e83 100644
--- a/cmd-find.c
+++ b/cmd-find.c
@@ -879,7 +879,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);
@@ -890,11 +890,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);
@@ -905,7 +904,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. */
@@ -942,6 +940,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)