Skip to content

Commit

Permalink
refactor: boxes: Extract footer reset logic into new method.
Browse files Browse the repository at this point in the history
  • Loading branch information
rsashank authored and neiljp committed Jul 14, 2024
1 parent d3251f2 commit f1e6c6d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions zulipterminal/ui_tools/boxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -715,14 +715,16 @@ def exit_compose_box(self) -> None:
self.main_view(False)
self.view.middle_column.set_focus("body")

def _set_default_footer_after_autocomplete(self) -> None:
self.is_in_typeahead_mode = False
self.view.set_footer_text()

def keypress(self, size: urwid_Size, key: str) -> Optional[str]:
if self.is_in_typeahead_mode and not (
is_command_key("AUTOCOMPLETE", key)
or is_command_key("AUTOCOMPLETE_REVERSE", key)
):
# set default footer when done with autocomplete
self.is_in_typeahead_mode = False
self.view.set_footer_text()
self._set_default_footer_after_autocomplete()

if is_command_key("SEND_MESSAGE", key):
self.send_stop_typing_status()
Expand Down

0 comments on commit f1e6c6d

Please sign in to comment.