Skip to content

Commit

Permalink
quit prompt limit functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
SilenZcience committed Jan 29, 2024
1 parent 9be24d7 commit 59c0ffa
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cat_win/util/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -535,9 +535,14 @@ def _render_scr() -> None:
_render_scr()
wchar, key = self._get_new_char()
if key in ACTION_HOTKEYS:
if key == b'_action_quit':
if key in [b'_action_quit', b'_action_interrupt']:
break
getattr(self, key.decode(), lambda *_: False)(write_func)
if key == b'_action_save':
getattr(self, key.decode(), lambda *_: False)(write_func)
if key == b'_action_resize':
getattr(self, key.decode(), lambda *_: False)(None)
self._render_scr()
curses.curs_set(0)
elif wchar.upper() in ['Y', 'J']:
self._action_save(write_func)
elif wchar == '\x1b': # ESC
Expand Down

0 comments on commit 59c0ffa

Please sign in to comment.