diff options
108 files changed, 209 insertions, 156 deletions
@@ -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 @@ -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 @@ -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 @@ -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 @@ -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(¤t, cmdq, flags); - if (cmd_find_current_session(¤t) != 0) { - if (~flags & CMD_FIND_QUIET) - cmdq_error(cmdq, "no current session"); - goto error; - } - fs->current = ¤t; - } + else + fs->current = current; /* An empty or NULL target is the current. */ if (target == NULL || *target == '\0') diff --git a/cmd-join-pane.c b/cmd-join-pane.c index e8ad3bd0..19186f3b 100644 --- a/cmd-join-pane.c +++ b/cmd-join-pane.c @@ -2,7 +2,7 @@ /* * Copyright (c) 2011 George Nachman <tmux@georgester.com> - * 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-kill-pane.c b/cmd-kill-pane.c index f843bc58..ebb2b8d6 100644 --- a/cmd-kill-pane.c +++ b/cmd-kill-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- |