The branch, hooks has been updated
       via  0a89fc921d6352ecf612a9413200d974729ab7d8 (commit)
       via  99d6c6d7c709e4fec9cf36d19ada2fafe1f2a3d8 (commit)
      from  29d5325a4565f255fcfc74edd420d6f252e1ff5f (commit)

- Log -----------------------------------------------------------------
commit 0a89fc921d6352ecf612a9413200d974729ab7d8
Merge: 99d6c6d 29d5325
Author: Nicholas Marriott <[email protected]>
Commit: Nicholas Marriott <[email protected]>

    Merge branch 'hooks' of ssh://git.code.sf.net/p/tmux/tmux-code into hooks

 cmd-respawn-pane.c  |   14 +++++---------
 cmd-rotate-window.c |   11 +++--------
 cmd-split-window.c  |   13 +++++--------
 3 files changed, 13 insertions(+), 25 deletions(-)


commit 99d6c6d7c709e4fec9cf36d19ada2fafe1f2a3d8
Author: Nicholas Marriott <[email protected]>
Commit: Nicholas Marriott <[email protected]>

    Use prepare flags for swap-window.
---
 cmd-swap-window.c |   21 +++++++++------------
 1 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/cmd-swap-window.c b/cmd-swap-window.c
index 655b910..e0d7832 100644
--- a/cmd-swap-window.c
+++ b/cmd-swap-window.c
@@ -32,31 +32,28 @@ const struct cmd_entry cmd_swap_window_entry = {
        "swap-window", "swapw",
        "ds:t:", 0, 0,
        "[-d] " CMD_SRCDST_WINDOW_USAGE,
-       0,
+       CMD_PREP_WINDOW_S|CMD_PREP_WINDOW_T,
        cmd_swap_window_exec
 };
 
 enum cmd_retval
 cmd_swap_window_exec(struct cmd *self, struct cmd_q *cmdq)
 {
-       struct args             *args = self->args;
-       const char              *target_src, *target_dst;
        struct session          *src, *dst;
        struct session_group    *sg_src, *sg_dst;
        struct winlink          *wl_src, *wl_dst;
        struct window           *w;
 
-       target_src = args_get(args, 's');
-       if ((wl_src = cmd_find_window(cmdq, target_src, &src)) == NULL)
-               return (CMD_RETURN_ERROR);
-       target_dst = args_get(args, 't');
-       if ((wl_dst = cmd_find_window(cmdq, target_dst, &dst)) == NULL)
-               return (CMD_RETURN_ERROR);
-
+       wl_src = cmdq->state.sflag.wl;
+       src = cmdq->state.sflag.s;
        sg_src = session_group_find(src);
+
+       wl_dst = cmdq->state.tflag.wl;
+       dst = cmdq->state.tflag.s;
        sg_dst = session_group_find(dst);
-       if (src != dst &&
-           sg_src != NULL && sg_dst != NULL && sg_src == sg_dst) {
+
+       if (src != dst && sg_src != NULL && sg_dst != NULL &&
+           sg_src == sg_dst) {
                cmdq_error(cmdq, "can't move window, sessions are grouped");
                return (CMD_RETURN_ERROR);
        }


-----------------------------------------------------------------------

Summary of changes:
 cmd-swap-window.c |   21 +++++++++------------
 1 files changed, 9 insertions(+), 12 deletions(-)


hooks/post-receive
-- 
tmux

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
tmux-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tmux-cvs

Reply via email to