Fix broken scrolling
This commit is contained in:
parent
bc1de92534
commit
0307497e06
@ -146,9 +146,6 @@ on_key_input(int key, int scancode, int action, int mods) {
|
|||||||
Window *w = active_window();
|
Window *w = active_window();
|
||||||
if (!w) return;
|
if (!w) return;
|
||||||
Screen *screen = w->render_data.screen;
|
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);
|
int lkey = get_localized_key(key, scancode);
|
||||||
if (action == GLFW_PRESS || action == GLFW_REPEAT) {
|
if (action == GLFW_PRESS || action == GLFW_REPEAT) {
|
||||||
uint16_t qkey = key_map[lkey];
|
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 (
|
if (
|
||||||
action == GLFW_PRESS ||
|
action == GLFW_PRESS ||
|
||||||
(action == GLFW_REPEAT && screen->modes.mDECARM) ||
|
(action == GLFW_REPEAT && screen->modes.mDECARM) ||
|
||||||
|
|||||||
@ -249,30 +249,24 @@ class Window:
|
|||||||
def scroll_line_up(self):
|
def scroll_line_up(self):
|
||||||
if self.screen.is_main_linebuf():
|
if self.screen.is_main_linebuf():
|
||||||
self.screen.scroll(SCROLL_LINE, True)
|
self.screen.scroll(SCROLL_LINE, True)
|
||||||
glfw_post_empty_event()
|
|
||||||
|
|
||||||
def scroll_line_down(self):
|
def scroll_line_down(self):
|
||||||
if self.screen.is_main_linebuf():
|
if self.screen.is_main_linebuf():
|
||||||
self.screen.scroll(SCROLL_LINE, False)
|
self.screen.scroll(SCROLL_LINE, False)
|
||||||
glfw_post_empty_event()
|
|
||||||
|
|
||||||
def scroll_page_up(self):
|
def scroll_page_up(self):
|
||||||
if self.screen.is_main_linebuf():
|
if self.screen.is_main_linebuf():
|
||||||
self.screen.scroll(SCROLL_PAGE, True)
|
self.screen.scroll(SCROLL_PAGE, True)
|
||||||
glfw_post_empty_event()
|
|
||||||
|
|
||||||
def scroll_page_down(self):
|
def scroll_page_down(self):
|
||||||
if self.screen.is_main_linebuf():
|
if self.screen.is_main_linebuf():
|
||||||
self.screen.scroll(SCROLL_PAGE, False)
|
self.screen.scroll(SCROLL_PAGE, False)
|
||||||
glfw_post_empty_event()
|
|
||||||
|
|
||||||
def scroll_home(self):
|
def scroll_home(self):
|
||||||
if self.screen.is_main_linebuf():
|
if self.screen.is_main_linebuf():
|
||||||
self.screen.scroll(SCROLL_FULL, True)
|
self.screen.scroll(SCROLL_FULL, True)
|
||||||
glfw_post_empty_event()
|
|
||||||
|
|
||||||
def scroll_end(self):
|
def scroll_end(self):
|
||||||
if self.screen.is_main_linebuf():
|
if self.screen.is_main_linebuf():
|
||||||
self.screen.scroll(SCROLL_FULL, False)
|
self.screen.scroll(SCROLL_FULL, False)
|
||||||
glfw_post_empty_event()
|
|
||||||
# }}}
|
# }}}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user