diff options
author | Thomas Adam <thomas@xteddy.org> | 2022-10-17 14:01:10 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2022-10-17 14:01:10 +0100 |
commit | 934f357149dba903f091237e7ea7c7ba78471614 (patch) | |
tree | 04902a6a701617666f989a9514f33964dcdcc23f | |
parent | 9ef854f5a9112a7d50c382dec403432dea2c3579 (diff) | |
parent | ff2766b024e6657b5f5f70dfd5acdb32085d7b70 (diff) | |
download | rtmux-934f357149dba903f091237e7ea7c7ba78471614.tar.gz rtmux-934f357149dba903f091237e7ea7c7ba78471614.tar.bz2 rtmux-934f357149dba903f091237e7ea7c7ba78471614.zip |
Merge branch 'obsd-master'
-rw-r--r-- | session.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -708,7 +708,7 @@ session_renumber_windows(struct session *s) struct winlink *wl, *wl1, *wl_new; struct winlinks old_wins; struct winlink_stack old_lastw; - int new_idx, new_curw_idx; + int new_idx, new_curw_idx, marked_idx = -1; /* Save and replace old window list. */ memcpy(&old_wins, &s->windows, sizeof old_wins); @@ -725,6 +725,8 @@ session_renumber_windows(struct session *s) winlink_set_window(wl_new, wl->window); wl_new->flags |= wl->flags & WINLINK_ALERTFLAGS; + if (wl == marked_pane.wl) + marked_idx = wl_new->idx; if (wl == s->curw) new_curw_idx = wl_new->idx; @@ -741,6 +743,11 @@ session_renumber_windows(struct session *s) } /* Set the current window. */ + if (marked_idx != -1) { + marked_pane.wl = winlink_find_by_index(&s->windows, marked_idx); + if (marked_pane.wl == NULL) + server_clear_marked(); + } s->curw = winlink_find_by_index(&s->windows, new_curw_idx); /* Free the old winlinks (reducing window references too). */ |