mirror of
https://github.com/tmate-io/tmate.git
synced 2024-11-23 08:33:17 +01:00
Redraw properly when scrolling backward and the cursor is on the last
line. Based on a fix from Micah Cowan.
This commit is contained in:
parent
b9ade6e6bb
commit
75e13c8977
@ -1075,6 +1075,7 @@ void
|
||||
window_copy_cursor_up(struct window_pane *wp, int scroll_only)
|
||||
{
|
||||
struct window_copy_mode_data *data = wp->modedata;
|
||||
struct screen *s = &data->screen;
|
||||
u_int ox, oy, px, py;
|
||||
|
||||
oy = screen_hsize(&wp->base) + data->cy - data->oy;
|
||||
@ -1087,12 +1088,20 @@ window_copy_cursor_up(struct window_pane *wp, int scroll_only)
|
||||
data->cx = data->lastcx;
|
||||
if (scroll_only || data->cy == 0) {
|
||||
window_copy_scroll_down(wp, 1);
|
||||
if (scroll_only)
|
||||
window_copy_redraw_lines(wp, data->cy, 2);
|
||||
if (scroll_only) {
|
||||
if (data->cy == screen_size_y(s) - 1)
|
||||
window_copy_redraw_lines(wp, data->cy, 1);
|
||||
else
|
||||
window_copy_redraw_lines(wp, data->cy, 2);
|
||||
}
|
||||
} else {
|
||||
window_copy_update_cursor(wp, data->cx, data->cy - 1);
|
||||
if (window_copy_update_selection(wp))
|
||||
window_copy_redraw_lines(wp, data->cy, 2);
|
||||
if (window_copy_update_selection(wp)) {
|
||||
if (data->cy == screen_size_y(s) - 1)
|
||||
window_copy_redraw_lines(wp, data->cy, 1);
|
||||
else
|
||||
window_copy_redraw_lines(wp, data->cy, 2);
|
||||
}
|
||||
}
|
||||
|
||||
py = screen_hsize(&wp->base) + data->cy - data->oy;
|
||||
|
Loading…
Reference in New Issue
Block a user