Fix broken scrolling

This commit is contained in:
Kovid Goyal 2017-09-16 17:11:30 +05:30
parent bc1de92534
commit 0307497e06
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 3 additions and 9 deletions

View File

@ -146,9 +146,6 @@ on_key_input(int key, int scancode, int action, int mods) {
Window *w = active_window();
if (!w) return;
Screen *screen = w->render_data.screen;
if (screen->scrolled_by && action == GLFW_PRESS && !is_modifier_key(key)) {
screen_history_scroll(screen, SCROLL_FULL, false); // scroll back to bottom
}
int lkey = get_localized_key(key, scancode);
if (action == GLFW_PRESS || action == GLFW_REPEAT) {
uint16_t qkey = key_map[lkey];
@ -168,6 +165,9 @@ on_key_input(int key, int scancode, int action, int mods) {
}
}
}
if (screen->scrolled_by && action == GLFW_PRESS && !is_modifier_key(key)) {
screen_history_scroll(screen, SCROLL_FULL, false); // scroll back to bottom
}
if (
action == GLFW_PRESS ||
(action == GLFW_REPEAT && screen->modes.mDECARM) ||

View File

@ -249,30 +249,24 @@ class Window:
def scroll_line_up(self):
if self.screen.is_main_linebuf():
self.screen.scroll(SCROLL_LINE, True)
glfw_post_empty_event()
def scroll_line_down(self):
if self.screen.is_main_linebuf():
self.screen.scroll(SCROLL_LINE, False)
glfw_post_empty_event()
def scroll_page_up(self):
if self.screen.is_main_linebuf():
self.screen.scroll(SCROLL_PAGE, True)
glfw_post_empty_event()
def scroll_page_down(self):
if self.screen.is_main_linebuf():
self.screen.scroll(SCROLL_PAGE, False)
glfw_post_empty_event()
def scroll_home(self):
if self.screen.is_main_linebuf():
self.screen.scroll(SCROLL_FULL, True)
glfw_post_empty_event()
def scroll_end(self):
if self.screen.is_main_linebuf():
self.screen.scroll(SCROLL_FULL, False)
glfw_post_empty_event()
# }}}