Skip to content

Commit

Permalink
console: add clean on F8
Browse files Browse the repository at this point in the history
  • Loading branch information
blavka committed Jul 29, 2022
1 parent 149e3f7 commit 43defdf
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/hardwario/chester/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,9 @@ def get_statusbar_text():
]

def get_statusbar_scroll_text():
if self.scroll_to_end:
return [
("class:title", '[F5] Pause scroll'),
]
return [
("class:red", '[F5] Resume scroll'),
("class:title", '[F5] Pause scroll') if self.scroll_to_end else ("class:red", '[F5] Resume scroll'),
("class:title", ' [F8] Clean')
]

def get_statusbar_time():
Expand Down Expand Up @@ -211,8 +208,13 @@ def _(event):
self.shell_buffer.cursor_position = len(self.shell_buffer.text)
self.logger_buffer.cursor_position = len(self.logger_buffer.text)

@bindings.add("c-q", eager=True)
@bindings.add("f4", eager=True)
@bindings.add("f8", eager=True)
def _(event):
self.shell_buffer.set_document(Document(''), True)
self.logger_buffer.set_document(Document(''), True)

@ bindings.add("c-q", eager=True)
@ bindings.add("f4", eager=True)
def _(event):
event.app.exit()

Expand Down

0 comments on commit 43defdf

Please sign in to comment.