diff options
Diffstat (limited to 'cmd-select-window.c')
-rw-r--r-- | cmd-select-window.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/cmd-select-window.c b/cmd-select-window.c index b741af51..4cc4b536 100644 --- a/cmd-select-window.c +++ b/cmd-select-window.c @@ -84,9 +84,10 @@ const struct cmd_entry cmd_last_window_entry = { static enum cmd_retval cmd_select_window_exec(struct cmd *self, struct cmdq_item *item) { - struct winlink *wl = item->state.tflag.wl; - struct session *s = item->state.tflag.s; - int next, previous, last, activity; + struct cmd_find_state *current = &item->shared->current; + struct winlink *wl = item->state.tflag.wl; + struct session *s = item->state.tflag.s; + int next, previous, last, activity; next = self->entry == &cmd_next_window_entry; if (args_has(self->args, 'n')) @@ -116,7 +117,7 @@ cmd_select_window_exec(struct cmd *self, struct cmdq_item *item) return (CMD_RETURN_ERROR); } } - + cmd_find_from_session(&item->shared->current, s); server_redraw_session(s); } else { /* @@ -128,9 +129,13 @@ cmd_select_window_exec(struct cmd *self, struct cmdq_item *item) cmdq_error(item, "no last window"); return (-1); } + if (current->s == s) + cmd_find_from_session(current, s); server_redraw_session(s); - } else if (session_select(s, wl->idx) == 0) + } else if (session_select(s, wl->idx) == 0) { + cmd_find_from_session(current, s); server_redraw_session(s); + } } recalculate_sizes(); |