mirror of
https://github.com/tmux/tmux.git
synced 2025-01-05 23:38:48 +00:00
Treat flags properly.
This commit is contained in:
parent
8216f7b3d9
commit
f8db8521c1
@ -1,4 +1,4 @@
|
|||||||
/* $Id: cmd-swap-pane.c,v 1.1 2009-04-02 23:28:16 nicm Exp $ */
|
/* $Id: cmd-swap-pane.c,v 1.2 2009-04-02 23:32:48 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -45,7 +45,7 @@ struct cmd_swap_pane_data {
|
|||||||
|
|
||||||
const struct cmd_entry cmd_swap_pane_entry = {
|
const struct cmd_entry cmd_swap_pane_entry = {
|
||||||
"swap-pane", "swapp",
|
"swap-pane", "swapp",
|
||||||
"[-dn] [-t target-window] [-p src-index] [-q dst-index]",
|
"[-dnr] [-t target-window] [-p src-index] [-q dst-index]",
|
||||||
0,
|
0,
|
||||||
cmd_swap_pane_init,
|
cmd_swap_pane_init,
|
||||||
cmd_swap_pane_parse,
|
cmd_swap_pane_parse,
|
||||||
@ -265,12 +265,15 @@ cmd_swap_pane_print(struct cmd *self, char *buf, size_t len)
|
|||||||
off += xsnprintf(buf, len, "%s", self->entry->name);
|
off += xsnprintf(buf, len, "%s", self->entry->name);
|
||||||
if (data == NULL)
|
if (data == NULL)
|
||||||
return (off);
|
return (off);
|
||||||
if (off < len && (data->flag_next || data->flag_detached)) {
|
if (off < len &&
|
||||||
|
(data->flag_next || data->flag_previous || data->flag_detached)) {
|
||||||
off += xsnprintf(buf + off, len - off, " -");
|
off += xsnprintf(buf + off, len - off, " -");
|
||||||
if (off < len && data->flag_next)
|
|
||||||
off += xsnprintf(buf + off, len - off, "d");
|
|
||||||
if (off < len && data->flag_detached)
|
if (off < len && data->flag_detached)
|
||||||
|
off += xsnprintf(buf + off, len - off, "d");
|
||||||
|
if (off < len && data->flag_next)
|
||||||
off += xsnprintf(buf + off, len - off, "n");
|
off += xsnprintf(buf + off, len - off, "n");
|
||||||
|
if (off < len && data->flag_previous)
|
||||||
|
off += xsnprintf(buf + off, len - off, "r");
|
||||||
}
|
}
|
||||||
if (off < len && data->target != NULL)
|
if (off < len && data->target != NULL)
|
||||||
off += cmd_prarg(buf + off, len - off, " -t ", data->target);
|
off += cmd_prarg(buf + off, len - off, " -t ", data->target);
|
||||||
|
Loading…
Reference in New Issue
Block a user