summaryrefslogtreecommitdiffstats
path: root/cmd-select-pane.c
diff options
context:
space:
mode:
authornicm <nicm>2020-05-26 08:47:50 +0000
committernicm <nicm>2020-05-26 08:47:50 +0000
commitca0166f26f52e87290fd3d96c10cc660e9ede437 (patch)
tree30a0d3ce70b91894d289d940b446ad18470a68d5 /cmd-select-pane.c
parentea610a311902b56c6466d79332592ab7f3dc501a (diff)
Do not try to use the last marked pane if it is invalid.
Diffstat (limited to 'cmd-select-pane.c')
-rw-r--r--cmd-select-pane.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/cmd-select-pane.c b/cmd-select-pane.c
index 3b639e06..313deefe 100644
--- a/cmd-select-pane.c
+++ b/cmd-select-pane.c
@@ -129,7 +129,10 @@ cmd_select_pane_exec(struct cmd *self, struct cmdq_item *item)
if (args_has(args, 'm') || args_has(args, 'M')) {
if (args_has(args, 'm') && !window_pane_visible(wp))
return (CMD_RETURN_NORMAL);
- lastwp = marked_pane.wp;
+ if (server_check_marked())
+ lastwp = marked_pane.wp;
+ else
+ lastwp = NULL;
if (args_has(args, 'M') || server_is_marked(s, wl, wp))
server_clear_marked();