mirror of
https://github.com/tmux/tmux.git
synced 2024-12-04 11:55:56 +00:00
Try to stay near the same line in modes if the current one is removed.
This commit is contained in:
parent
a869693405
commit
9528d7470b
@ -356,8 +356,13 @@ mode_tree_set_current(struct mode_tree_data *mtd, uint64_t tag)
|
|||||||
mtd->offset = 0;
|
mtd->offset = 0;
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
mtd->current = 0;
|
if (mtd->current >= mtd->line_size) {
|
||||||
mtd->offset = 0;
|
mtd->current = mtd->line_size - 1;
|
||||||
|
if (mtd->current > mtd->height - 1)
|
||||||
|
mtd->offset = mtd->current - mtd->height + 1;
|
||||||
|
else
|
||||||
|
mtd->offset = 0;
|
||||||
|
}
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user