Quit the editor with ESC or (ctrl-x, ctrl-c).
This commit is contained in:
parent
e7a4addd77
commit
d8fe0d73a5
1 changed files with 9 additions and 1 deletions
|
|
@ -458,6 +458,13 @@ class Editor:
|
|||
self.text_widget.theme = theme
|
||||
self.text_widget.syntax_highlight_all()
|
||||
|
||||
def quit(self):
|
||||
fill3.SHUTDOWN_EVENT.set()
|
||||
|
||||
def ctrl_c(self):
|
||||
if self.previous_term_code == terminal.CTRL_X:
|
||||
self.quit()
|
||||
|
||||
def get_text(self):
|
||||
return self.text_widget.get_text()
|
||||
|
||||
|
|
@ -555,7 +562,8 @@ class Editor:
|
|||
terminal.ALT_CARROT: join_lines, terminal.ALT_h: highlight_block,
|
||||
terminal.ALT_H: highlight_block, terminal.CTRL_R: syntax_highlight_all,
|
||||
terminal.CTRL_L: center_cursor, terminal.ALT_SEMICOLON: comment_highlighted,
|
||||
terminal.ALT_c: cycle_syntax_highlighting, terminal.CTRL_X: prefix}
|
||||
terminal.ALT_c: cycle_syntax_highlighting, terminal.CTRL_X: prefix, terminal.ESC: quit,
|
||||
terminal.CTRL_C: ctrl_c}
|
||||
|
||||
|
||||
def main():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue