From 4d9e6ea3106ea06afa4583254549d525b31ed277 Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 13 Oct 2016 10:01:49 +0000 Subject: Some improvements and bug fixes for hooks: - Prepare the state again before the "after" hooks are run, because the command may have killed or moved windows. - Use the hooks list from the newly prepared target, not the old hooks list (only matters for new-session really). - Correctly detect an invalid current state and ignore it in cmd_find_target ("killw; swapw"). - Change neww, new, killp, killw, splitw, swapp, swapw to update the current state (used if no explicit target is given) to something more useful after they have finished. For example, neww changes it to the newly created window. Hooks are still relatively new and primitive so there are likely to be more changes to come. Parts based on bug reports from Uwe Werler and Iblis Lin. --- cmd-join-pane.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'cmd-join-pane.c') diff --git a/cmd-join-pane.c b/cmd-join-pane.c index 3ff8f08e..a337e728 100644 --- a/cmd-join-pane.c +++ b/cmd-join-pane.c @@ -156,5 +156,12 @@ cmd_join_pane_exec(struct cmd *self, struct cmd_q *cmdq) notify_window_layout_changed(src_w); notify_window_layout_changed(dst_w); + cmd_find_clear_state(&cmdq->current, NULL, 0); + cmdq->current.s = dst_s; + cmdq->current.wl = dst_wl; + cmdq->current.w = dst_w; + cmdq->current.wp = dst_wp; + cmd_find_log_state(__func__, &cmdq->current); + return (CMD_RETURN_NORMAL); } -- cgit v1.2.3