aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2016-01-19 18:01:15 +0000
committerThomas Adam <thomas@xteddy.org>2016-01-19 18:01:15 +0000
commitdc42c35f1f04d3bd431c52dde0906965c6db2d6c (patch)
tree6b9e46226bd4ef64ab3e1c5c8bd65bdbc3cce3b9
parent5d21faa99c9a005208e88be72ef2c1e02cf6d128 (diff)
parentb5b5221c13ded5b141fa35f60c707c9c403b83a6 (diff)
downloadrtmux-dc42c35f1f04d3bd431c52dde0906965c6db2d6c.tar.gz
rtmux-dc42c35f1f04d3bd431c52dde0906965c6db2d6c.tar.bz2
rtmux-dc42c35f1f04d3bd431c52dde0906965c6db2d6c.zip
Merge branch 'obsd-master'
-rw-r--r--alerts.c2
-rw-r--r--arguments.c2
-rw-r--r--array.h2
-rw-r--r--cfg.c2
-rw-r--r--client.c2
-rw-r--r--cmd-attach-session.c2
-rw-r--r--cmd-bind-key.c2
-rw-r--r--cmd-break-pane.c2
-rw-r--r--cmd-choose-buffer.c2
-rw-r--r--cmd-choose-client.c2
-rw-r--r--cmd-clear-history.c2
-rw-r--r--cmd-command-prompt.c2
-rw-r--r--cmd-copy-mode.c2
-rw-r--r--cmd-detach-client.c2
-rw-r--r--cmd-display-panes.c2
-rw-r--r--cmd-find-window.c2
-rw-r--r--cmd-find.c31
-rw-r--r--cmd-join-pane.c2
-rw-r--r--cmd-kill-pane.c2
-rw-r--r--cmd-kill-server.c2
-rw-r--r--cmd-kill-session.c2
-rw-r--r--cmd-kill-window.c2
-rw-r--r--cmd-list-buffers.c2
-rw-r--r--cmd-list-clients.c2
-rw-r--r--cmd-list-keys.c2
-rw-r--r--cmd-list-panes.c2
-rw-r--r--cmd-list-sessions.c2
-rw-r--r--cmd-list-windows.c2
-rw-r--r--cmd-list.c2
-rw-r--r--cmd-lock-server.c2
-rw-r--r--cmd-move-window.c2
-rw-r--r--cmd-new-session.c2
-rw-r--r--cmd-new-window.c2
-rw-r--r--cmd-paste-buffer.c2
-rw-r--r--cmd-pipe-pane.c2
-rw-r--r--cmd-queue.c4
-rw-r--r--cmd-refresh-client.c2
-rw-r--r--cmd-rename-session.c2
-rw-r--r--cmd-rename-window.c2
-rw-r--r--cmd-resize-pane.c2
-rw-r--r--cmd-respawn-pane.c2
-rw-r--r--cmd-respawn-window.c2
-rw-r--r--cmd-rotate-window.c2
-rw-r--r--cmd-select-layout.c2
-rw-r--r--cmd-select-pane.c2
-rw-r--r--cmd-select-window.c2
-rw-r--r--cmd-send-keys.c2
-rw-r--r--cmd-set-buffer.c2
-rw-r--r--cmd-set-environment.c2
-rw-r--r--cmd-set-option.c2
-rw-r--r--cmd-show-environment.c2
-rw-r--r--cmd-show-messages.c2
-rw-r--r--cmd-show-options.c2
-rw-r--r--cmd-split-window.c2
-rw-r--r--cmd-string.c2
-rw-r--r--cmd-swap-pane.c2
-rw-r--r--cmd-swap-window.c2
-rw-r--r--cmd-switch-client.c2
-rw-r--r--cmd-unbind-key.c2
-rw-r--r--cmd-wait-for.c2
-rw-r--r--cmd.c108
-rw-r--r--colour.c2
-rw-r--r--control-notify.c2
-rw-r--r--control.c2
-rw-r--r--environ.c2
-rw-r--r--format.c2
-rw-r--r--grid-view.c2
-rw-r--r--grid.c2
-rw-r--r--input-keys.c2
-rw-r--r--input.c2
-rw-r--r--job.c2
-rw-r--r--key-bindings.c2
-rw-r--r--key-string.c2
-rw-r--r--layout-custom.c2
-rw-r--r--layout-set.c2
-rw-r--r--layout.c2
-rw-r--r--log.c2
-rw-r--r--mode-key.c2
-rw-r--r--names.c2
-rw-r--r--options-table.c2
-rw-r--r--options.c2
-rw-r--r--osdep-openbsd.c2
-rw-r--r--paste.c2
-rw-r--r--proc.c2
-rw-r--r--resize.c2
-rw-r--r--screen-redraw.c2
-rw-r--r--screen-write.c2
-rw-r--r--screen.c2
-rw-r--r--server-client.c2
-rw-r--r--server-fn.c2
-rw-r--r--server.c2
-rw-r--r--session.c2
-rw-r--r--signal.c2
-rw-r--r--status.c2
-rw-r--r--style.c2
-rw-r--r--tmux.14
-rw-r--r--tmux.c2
-rw-r--r--tmux.h12
-rw-r--r--tty-acs.c2
-rw-r--r--tty-keys.c2
-rw-r--r--tty-term.c2
-rw-r--r--tty.c2
-rw-r--r--utf8.c2
-rw-r--r--window-choose.c2
-rw-r--r--window-clock.c2
-rw-r--r--window-copy.c2
-rw-r--r--window.c2
-rw-r--r--xterm-keys.c2
108 files changed, 209 insertions, 156 deletions
diff --git a/alerts.c b/alerts.c
index d1fb0fce..cca0d815 100644
--- a/alerts.c
+++ b/alerts.c
@@ -1,7 +1,7 @@
/* $OpenBSD$ */
/*
- * Copyright (c) 2015 Nicholas Marriott <nicm@users.sourceforge.net>
+ * Copyright (c) 2015 Nicholas Marriott <nicholas.marriott@gmail.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
diff --git a/arguments.c b/arguments.c
index 16ad5110..f7f8f737 100644
--- a/arguments.c
+++ b/arguments.c
@@ -1,7 +1,7 @@
/* $OpenBSD$ */
/*
- * Copyright (c) 2010 Nicholas Marriott <nicm@users.sourceforge.net>
+ * Copyright (c) 2010 Nicholas Marriott <nicholas.marriott@gmail.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
diff --git a/array.h b/array.h
index 671bea42..209de0c5 100644
--- a/array.h
+++ b/array.h
@@ -1,7 +1,7 @@
/* $OpenBSD$ */
/*
- * Copyright (c) 2006 Nicholas Marriott <nicm@users.sourceforge.net>
+ * Copyright (c) 2006 Nicholas Marriott <nicholas.marriott@gmail.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
diff --git a/cfg.c b/cfg.c
index 975b89a4..50882738 100644
--- a/cfg.c
+++ b/cfg.c
@@ -1,7 +1,7 @@
/* $OpenBSD$ */
/*
- * Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
+ * Copyright (c) 2008 Nicholas Marriott <nicholas.marriott@gmail.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
diff --git a/client.c b/client.c
index e24d07e8..32034123 100644
--- a/client.c
+++ b/client.c
@@ -1,7 +1,7 @@
/* $OpenBSD$ */
/*
- * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
+ * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
diff --git a/cmd-attach-session.c b/cmd-attach-session.c
index 993f4c75..53c1df31 100644
--- a/cmd-attach-session.c
+++ b/cmd-attach-session.c
@@ -1,7 +1,7 @@
/* $OpenBSD$ */
/*
- * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
+ * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
diff --git a/cmd-bind-key.c b/cmd-bind-key.c
index df3285f7..a829a2c5 100644
--- a/cmd-bind-key.c
+++ b/cmd-bind-key.c
@@ -1,7 +1,7 @@
/* $OpenBSD$ */
/*
- * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
+ * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
diff --git a/cmd-break-pane.c b/cmd-break-pane.c
index c2b021fc..b5a2743f 100644
--- a/cmd-break-pane.c
+++ b/cmd-break-pane.c
@@ -1,7 +1,7 @@
/* $OpenBSD$ */
/*
- * Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
+ * Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
diff --git a/cmd-choose-buffer.c b/cmd-choose-buffer.c
index 1f8fbfb2..90872e90 100644
--- a/cmd-choose-buffer.c
+++ b/cmd-choose-buffer.c
@@ -1,7 +1,7 @@
/* $OpenBSD$ */
/*
- * Copyright (c) 2010 Nicholas Marriott <nicm@users.sourceforge.net>
+ * Copyright (c) 2010 Nicholas Marriott <nicholas.marriott@gmail.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
diff --git a/cmd-choose-client.c b/cmd-choose-client.c
index 7d5fc606..b9a24be6 100644
--- a/cmd-choose-client.c
+++ b/cmd-choose-client.c
@@ -1,7 +1,7 @@
/* $OpenBSD$ */
/*
- * Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
+ * Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
diff --git a/cmd-clear-history.c b/cmd-clear-history.c
index 1236e7f1..62683ff6 100644
--- a/cmd-clear-history.c
+++ b/cmd-clear-history.c
@@ -1,7 +1,7 @@
/* $OpenBSD$ */
/*
- * Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
+ * Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
diff --git a/cmd-command-prompt.c b/cmd-command-prompt.c
index 9200ada1..3ec22865 100644
--- a/cmd-command-prompt.c
+++ b/cmd-command-prompt.c
@@ -1,7 +1,7 @@
/* $OpenBSD$ */
/*
- * Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
+ * Copyright (c) 2008 Nicholas Marriott <nicholas.marriott@gmail.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
diff --git a/cmd-copy-mode.c b/cmd-copy-mode.c
index 49f5b30c..beb4d7c8 100644
--- a/cmd-copy-mode.c
+++ b/cmd-copy-mode.c
@@ -1,7 +1,7 @@
/* $OpenBSD$ */
/*
- * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
+ * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
diff --git a/cmd-detach-client.c b/cmd-detach-client.c
index daf9a5c6..80c6555f 100644
--- a/cmd-detach-client.c
+++ b/cmd-detach-client.c
@@ -1,7 +1,7 @@
/* $OpenBSD$ */
/*
- * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
+ * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
diff --git a/cmd-display-panes.c b/cmd-display-panes.c
index d8db4066..eed3611e 100644
--- a/cmd-display-panes.c
+++ b/cmd-display-panes.c
@@ -1,7 +1,7 @@
/* $OpenBSD$ */
/*
- * Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
+ * Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
diff --git a/cmd-find-window.c b/cmd-find-window.c
index eb940d8c..6324f26a 100644
--- a/cmd-find-window.c
+++ b/cmd-find-window.c
@@ -1,7 +1,7 @@
/* $OpenBSD$ */
/*
- * Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
+ * Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
diff --git a/cmd-find.c b/cmd-find.c
index ff795427..f6094ced 100644
--- a/cmd-find.c
+++ b/cmd-find.c
@@ -1,7 +1,7 @@
/* $OpenBSD$ */
/*
- * Copyright (c) 2015 Nicholas Marriott <nicm@users.sourceforge.net>
+ * Copyright (c) 2015 Nicholas Marriott <nicholas.marriott@gmail.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -922,15 +922,27 @@ cmd_find_from_pane(struct cmd_find_state *fs, struct window_pane *wp)
return (0);
}
+/* Find current state. */
+int
+cmd_find_current(struct cmd_find_state *fs, struct cmd_q *cmdq, int flags)
+{
+ cmd_find_clear_state(fs, cmdq, flags);
+ if (cmd_find_current_session(fs) != 0) {
+ if (~flags & CMD_FIND_QUIET)
+ cmdq_error(cmdq, "no current session");
+ return (-1);
+ }
+ return (0);
+}
+
/*
* Split target into pieces and resolve for the given type. Fills in the given
* state. Returns 0 on success or -1 on error.
*/
int
-cmd_find_target(struct cmd_find_state *fs, struct cmd_q *cmdq,
- const char *target, enum cmd_find_type type, int flags)
+cmd_find_target(struct cmd_find_state *fs, struct cmd_find_state *current,
+ struct cmd_q *cmdq, const char *target, enum cmd_find_type type, int flags)
{
- struct cmd_find_state current;
struct mouse_event *m;
char *colon, *period, *copy = NULL;
const char *session, *window, *pane;
@@ -950,15 +962,8 @@ cmd_find_target(struct cmd_find_state *fs, struct cmd_q *cmdq,
fs->current = &marked_pane;
else if (cmd_find_valid_state(&cmdq->current))
fs->current = &cmdq->current;
- else {
- cmd_find_clear_state(&current, cmdq, flags);
- if (cmd_find_current_session(&current) != 0) {
- if (~flags & CMD_FIND_QUIET)
- cmdq_error(cmdq, "no current session");
- goto error;
- }
- fs->current = &current;
- }
+ else
+ fs->current = current;
/* An empty or NULL target is th