mirror of
https://github.com/tmux/tmux.git
synced 2025-09-02 13:33:27 +00:00
Adjust the logic when deleting last buffer to better preserve the
selection: if selecting the element below the deleted one fails (because as the last one), select the one above it instead. From Daniel Mueller, GitHub issue 4043.
This commit is contained in:
@ -261,19 +261,21 @@ mode_tree_up(struct mode_tree_data *mtd, int wrap)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
int
|
||||
mode_tree_down(struct mode_tree_data *mtd, int wrap)
|
||||
{
|
||||
if (mtd->current == mtd->line_size - 1) {
|
||||
if (wrap) {
|
||||
mtd->current = 0;
|
||||
mtd->offset = 0;
|
||||
}
|
||||
} else
|
||||
return (0);
|
||||
} else {
|
||||
mtd->current++;
|
||||
if (mtd->current > mtd->offset + mtd->height - 1)
|
||||
mtd->offset++;
|
||||
}
|
||||
return (1);
|
||||
}
|
||||
|
||||
void *
|
||||
|
Reference in New Issue
Block a user