mirror of
https://github.com/tmux/tmux.git
synced 2025-01-13 03:48:51 +00:00
Do not crash if the screen size is too small for the indicator in copy mode.
This commit is contained in:
parent
de68c2a7da
commit
bbf743769b
@ -1055,6 +1055,8 @@ window_copy_write_line(
|
|||||||
if (py == 0) {
|
if (py == 0) {
|
||||||
size = xsnprintf(hdr, sizeof hdr,
|
size = xsnprintf(hdr, sizeof hdr,
|
||||||
"[%u/%u]", data->oy, screen_hsize(data->backing));
|
"[%u/%u]", data->oy, screen_hsize(data->backing));
|
||||||
|
if (size > screen_size_x(s))
|
||||||
|
size = screen_size_x(s);
|
||||||
screen_write_cursormove(ctx, screen_size_x(s) - size, 0);
|
screen_write_cursormove(ctx, screen_size_x(s) - size, 0);
|
||||||
screen_write_puts(ctx, &gc, "%s", hdr);
|
screen_write_puts(ctx, &gc, "%s", hdr);
|
||||||
} else if (py == last && data->inputtype != WINDOW_COPY_OFF) {
|
} else if (py == last && data->inputtype != WINDOW_COPY_OFF) {
|
||||||
|
Loading…
Reference in New Issue
Block a user