editor: Let ctrl-z also mean undo
- ctrl-z was free and many people would try for ctrl-z first.
This commit is contained in:
parent
0c7f5272ae
commit
2876aab6c8
1 changed files with 2 additions and 2 deletions
|
|
@ -573,7 +573,7 @@ class Editor:
|
||||||
self.history.append((self.text_widget.actual_text.copy(), self._cursor_x, self._cursor_y))
|
self.history.append((self.text_widget.actual_text.copy(), self._cursor_x, self._cursor_y))
|
||||||
|
|
||||||
def on_keyboard_input(self, term_code):
|
def on_keyboard_input(self, term_code):
|
||||||
if term_code != terminal.CTRL_UNDERSCORE:
|
if term_code not in [terminal.CTRL_UNDERSCORE, terminal.CTRL_Z]:
|
||||||
self.add_to_history()
|
self.add_to_history()
|
||||||
if term_code in Editor.KEY_MAP:
|
if term_code in Editor.KEY_MAP:
|
||||||
try:
|
try:
|
||||||
|
|
@ -654,7 +654,7 @@ class Editor:
|
||||||
terminal.CTRL_L: center_cursor, terminal.ALT_SEMICOLON: comment_lines,
|
terminal.CTRL_L: center_cursor, terminal.ALT_SEMICOLON: comment_lines,
|
||||||
terminal.ALT_c: cycle_syntax_highlighting, terminal.CTRL_X: prefix, terminal.ESC: quit,
|
terminal.ALT_c: cycle_syntax_highlighting, terminal.CTRL_X: prefix, terminal.ESC: quit,
|
||||||
terminal.CTRL_C: ctrl_c, terminal.CTRL_K: delete_line, terminal.TAB: tab_align,
|
terminal.CTRL_C: ctrl_c, terminal.CTRL_K: delete_line, terminal.TAB: tab_align,
|
||||||
terminal.CTRL_UNDERSCORE: undo, terminal.CTRL_G: abort_command}
|
terminal.CTRL_UNDERSCORE: undo, terminal.CTRL_Z: undo, terminal.CTRL_G: abort_command}
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue