=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-move-window.c,v retrieving revision 1.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- src/usr.bin/tmux/cmd-move-window.c 2020/04/22 21:15:33 1.32 +++ src/usr.bin/tmux/cmd-move-window.c 2020/06/13 09:05:53 1.33 @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-move-window.c,v 1.32 2020/04/22 21:15:33 nicm Exp $ */ +/* $OpenBSD: cmd-move-window.c,v 1.33 2020/06/13 09:05:53 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott @@ -32,8 +32,8 @@ .name = "move-window", .alias = "movew", - .args = { "adkrs:t:", 0, 0 }, - .usage = "[-dkr] " CMD_SRCDST_WINDOW_USAGE, + .args = { "abdkrs:t:", 0, 0 }, + .usage = "[-abdkr] " CMD_SRCDST_WINDOW_USAGE, .source = { 's', CMD_FIND_WINDOW, 0 }, /* -t is special */ @@ -46,8 +46,8 @@ .name = "link-window", .alias = "linkw", - .args = { "adks:t:", 0, 0 }, - .usage = "[-dk] " CMD_SRCDST_WINDOW_USAGE, + .args = { "abdks:t:", 0, 0 }, + .usage = "[-abdk] " CMD_SRCDST_WINDOW_USAGE, .source = { 's', CMD_FIND_WINDOW, 0 }, /* -t is special */ @@ -67,7 +67,7 @@ struct session *dst; struct winlink *wl = source->wl; char *cause; - int idx, kflag, dflag, sflag; + int idx, kflag, dflag, sflag, before; if (args_has(args, 'r')) { if (cmd_find_target(&target, item, tflag, CMD_FIND_SESSION, @@ -90,11 +90,12 @@ dflag = args_has(args, 'd'); sflag = args_has(args, 's'); - if (args_has(args, 'a')) { + before = args_has(args, 'b'); + if (args_has(args, 'a') || before) { if (target.wl != NULL) - idx = winlink_shuffle_up(dst, target.wl); + idx = winlink_shuffle_up(dst, target.wl, before); else - idx = winlink_shuffle_up(dst, dst->curw); + idx = winlink_shuffle_up(dst, dst->curw, before); if (idx == -1) return (CMD_RETURN_ERROR); }