Skip to content

Commit

Permalink
#203 update focus when window is removed from stack
Browse files Browse the repository at this point in the history
  • Loading branch information
koekeishiya committed Jun 28, 2020
1 parent 53d44f2 commit a4210a6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/view.c
Original file line number Diff line number Diff line change
Expand Up @@ -526,11 +526,15 @@ void view_remove_window_node(struct view *view, struct window *window)
if (node->window_count > 1) {
for (int i = 0; i < node->window_count; ++i) {
if (node->window_id[i] == window->id) {
if (i == node->window_count-1) {
node->window_index = node->window_count-2;
}

node->window_id[i] = node->window_id[--node->window_count];
if (node->window_index == node->window_count) node->window_index = i;
break;
}
}

return;
}

Expand Down

0 comments on commit a4210a6

Please sign in to comment.