Allow for faster scrolling in alternate screen mode

This commit is contained in:
Luflosi 2018-08-29 14:04:12 +02:00
parent b891f4f874
commit 2454ecd586
No known key found for this signature in database
GPG Key ID: 14140F703B7D8362

View File

@ -565,7 +565,12 @@ scroll_event(double UNUSED xoffset, double yoffset, int flags) {
} else {
if (screen->modes.mouse_tracking_mode) {
int sz = encode_mouse_event(w, upwards ? GLFW_MOUSE_BUTTON_4 : GLFW_MOUSE_BUTTON_5, PRESS, 0);
if (sz > 0) { mouse_event_buf[sz] = 0; write_escape_code_to_child(screen, CSI, mouse_event_buf); }
if (sz > 0) {
mouse_event_buf[sz] = 0;
for (s = abs(s); s > 0; s--) {
write_escape_code_to_child(screen, CSI, mouse_event_buf);
}
}
} else {
fake_scroll(abs(s), upwards);
}