=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-join-pane.c,v retrieving revision 1.11 retrieving revision 1.12 diff -c -r1.11 -r1.12 *** src/usr.bin/tmux/cmd-join-pane.c 2012/07/10 11:53:01 1.11 --- src/usr.bin/tmux/cmd-join-pane.c 2012/07/11 07:10:15 1.12 *************** *** 1,4 **** ! /* $OpenBSD: cmd-join-pane.c,v 1.11 2012/07/10 11:53:01 nicm Exp $ */ /* * Copyright (c) 2011 George Nachman --- 1,4 ---- ! /* $OpenBSD: cmd-join-pane.c,v 1.12 2012/07/11 07:10:15 nicm Exp $ */ /* * Copyright (c) 2011 George Nachman *************** *** 29,38 **** * Join or move a pane into another (like split/swap/kill). */ ! void cmd_join_pane_key_binding(struct cmd *, int); ! int cmd_join_pane_exec(struct cmd *, struct cmd_ctx *); ! int join_pane(struct cmd *, struct cmd_ctx *, int); const struct cmd_entry cmd_join_pane_entry = { "join-pane", "joinp", --- 29,38 ---- * Join or move a pane into another (like split/swap/kill). */ ! void cmd_join_pane_key_binding(struct cmd *, int); ! enum cmd_retval cmd_join_pane_exec(struct cmd *, struct cmd_ctx *); ! enum cmd_retval join_pane(struct cmd *, struct cmd_ctx *, int); const struct cmd_entry cmd_join_pane_entry = { "join-pane", "joinp", *************** *** 68,80 **** } } ! int cmd_join_pane_exec(struct cmd *self, struct cmd_ctx *ctx) { return (join_pane(self, ctx, self->entry == &cmd_join_pane_entry)); } ! int join_pane(struct cmd *self, struct cmd_ctx *ctx, int not_same_window) { struct args *args = self->args; --- 68,80 ---- } } ! enum cmd_retval cmd_join_pane_exec(struct cmd *self, struct cmd_ctx *ctx) { return (join_pane(self, ctx, self->entry == &cmd_join_pane_entry)); } ! enum cmd_retval join_pane(struct cmd *self, struct cmd_ctx *ctx, int not_same_window) { struct args *args = self->args; *************** *** 89,110 **** dst_wl = cmd_find_pane(ctx, args_get(args, 't'), &dst_s, &dst_wp); if (dst_wl == NULL) ! return (-1); dst_w = dst_wl->window; dst_idx = dst_wl->idx; src_wl = cmd_find_pane(ctx, args_get(args, 's'), NULL, &src_wp); if (src_wl == NULL) ! return (-1); src_w = src_wl->window; if (not_same_window && src_w == dst_w) { ctx->error(ctx, "can't join a pane to its own window"); ! return (-1); } if (!not_same_window && src_wp == dst_wp) { ctx->error(ctx, "source and target panes must be different"); ! return (-1); } type = LAYOUT_TOPBOTTOM; --- 89,110 ---- dst_wl = cmd_find_pane(ctx, args_get(args, 't'), &dst_s, &dst_wp); if (dst_wl == NULL) ! return (CMD_RETURN_ERROR); dst_w = dst_wl->window; dst_idx = dst_wl->idx; src_wl = cmd_find_pane(ctx, args_get(args, 's'), NULL, &src_wp); if (src_wl == NULL) ! return (CMD_RETURN_ERROR); src_w = src_wl->window; if (not_same_window && src_w == dst_w) { ctx->error(ctx, "can't join a pane to its own window"); ! return (CMD_RETURN_ERROR); } if (!not_same_window && src_wp == dst_wp) { ctx->error(ctx, "source and target panes must be different"); ! return (CMD_RETURN_ERROR); } type = LAYOUT_TOPBOTTOM; *************** *** 117,130 **** if (cause != NULL) { ctx->error(ctx, "size %s", cause); free(cause); ! return (-1); } } else if (args_has(args, 'p')) { percentage = args_strtonum(args, 'p', 0, 100, &cause); if (cause != NULL) { ctx->error(ctx, "percentage %s", cause); free(cause); ! return (-1); } if (type == LAYOUT_TOPBOTTOM) size = (dst_wp->sy * percentage) / 100; --- 117,130 ---- if (cause != NULL) { ctx->error(ctx, "size %s", cause); free(cause); ! return (CMD_RETURN_ERROR); } } else if (args_has(args, 'p')) { percentage = args_strtonum(args, 'p', 0, 100, &cause); if (cause != NULL) { ctx->error(ctx, "percentage %s", cause); free(cause); ! return (CMD_RETURN_ERROR); } if (type == LAYOUT_TOPBOTTOM) size = (dst_wp->sy * percentage) / 100; *************** *** 134,140 **** lc = layout_split_pane(dst_wp, type, size, args_has(args, 'b')); if (lc == NULL) { ctx->error(ctx, "create pane failed: pane too small"); ! return (-1); } layout_close_pane(src_wp); --- 134,140 ---- lc = layout_split_pane(dst_wp, type, size, args_has(args, 'b')); if (lc == NULL) { ctx->error(ctx, "create pane failed: pane too small"); ! return (CMD_RETURN_ERROR); } layout_close_pane(src_wp); *************** *** 168,172 **** server_status_session(dst_s); notify_window_layout_changed(dst_w); ! return (0); } --- 168,172 ---- server_status_session(dst_s); notify_window_layout_changed(dst_w); ! return (CMD_RETURN_NORMAL); }