When searching in copy mode, do not scroll if the result is already on

screen. GitHub issue 1150.
This commit is contained in:
nicm 2017-11-13 11:49:11 +00:00
parent 384736e955
commit d81fa579c3

View File

@ -955,6 +955,9 @@ window_copy_scroll_to(struct window_pane *wp, u_int px, u_int py)
data->cx = px;
if (py >= gd->hsize - data->oy && py < gd->hsize - data->oy + gd->sy)
data->cy = py - (gd->hsize - data->oy);
else {
gap = gd->sy / 4;
if (py < gd->sy) {
offset = 0;
@ -967,6 +970,7 @@ window_copy_scroll_to(struct window_pane *wp, u_int px, u_int py)
data->cy = py - offset;
}
data->oy = gd->hsize - offset;
}
window_copy_update_selection(wp, 1);
window_copy_redraw_screen(wp);