Shortcuts for scrolling to the start and end of the scrollback buffer
This commit is contained in:
parent
b426210e38
commit
204411e5b8
@ -122,6 +122,8 @@ class Boss(Thread):
|
||||
passthrough = func()
|
||||
if not passthrough:
|
||||
return
|
||||
if self.char_grid.scrolled_by:
|
||||
self.scroll_end()
|
||||
data = interpret_key_event(key, scancode, mods)
|
||||
if data:
|
||||
self.write_to_child(data)
|
||||
@ -292,4 +294,10 @@ class Boss(Thread):
|
||||
|
||||
def scroll_page_down(self):
|
||||
self.queue_action(self.char_grid.scroll, 'page', False)
|
||||
|
||||
def scroll_home(self):
|
||||
self.queue_action(self.char_grid.scroll, 'full', True)
|
||||
|
||||
def scroll_end(self):
|
||||
self.queue_action(self.char_grid.scroll, 'full', False)
|
||||
# }}}
|
||||
|
||||
@ -219,7 +219,7 @@ class CharGrid:
|
||||
self.clear_count = 4
|
||||
|
||||
def scroll(self, amt, upwards=True):
|
||||
amt = 1 if amt == 'line' else self.screen.lines - 1 if amt == 'page' else max(0, min(int(amt), self.screen.lines - 1))
|
||||
amt = {'line': 1, 'page': self.screen.lines - 1, 'full': self.screen.historybuf.count}[amt]
|
||||
if not upwards:
|
||||
amt *= -1
|
||||
y = max(0, min(self.scrolled_by + amt, self.screen.historybuf.count))
|
||||
|
||||
@ -341,7 +341,9 @@ map ctrl+shift+c copy_to_clipboard
|
||||
map ctrl+shift+up scroll_line_up
|
||||
map ctrl+shift+down scroll_line_down
|
||||
map ctrl+shift+page_up scroll_page_up
|
||||
map Ctrl+Shift+page_down scroll_page_down
|
||||
map ctrl+shift+page_down scroll_page_down
|
||||
map ctrl+shift+home scroll_home
|
||||
map ctrl+shift+end scroll_end
|
||||
'''
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user