Skip to content

Commit 424eb98

Browse files
committed
testing
1 parent f9d0982 commit 424eb98

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

zulipterminal/ui_tools/views.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ def __init__(self, streams_btn_list: List[Any], view: Any) -> None:
295295
self.view = view
296296
self.log = urwid.SimpleFocusListWalker(streams_btn_list)
297297
self.streams_btn_list = streams_btn_list
298+
self.in_search_mode = False
298299
self.focus_index_before_search = 0
299300
list_box = urwid.ListBox(self.log)
300301
self.stream_search_box = PanelSearchBox(self,
@@ -356,6 +357,7 @@ def mouse_event(self, size: urwid_Size, event: str, button: int, col: int,
356357

357358
def keypress(self, size: urwid_Size, key: str) -> Optional[str]:
358359
if is_command_key('SEARCH_STREAMS', key):
360+
self.in_search_mode = True
359361
self.set_focus('header')
360362
return key
361363
elif is_command_key('GO_BACK', key):
@@ -365,9 +367,11 @@ def keypress(self, size: urwid_Size, key: str) -> Optional[str]:
365367
self.set_focus('body')
366368
self.log.set_focus(self.focus_index_before_search)
367369
self.view.controller.update_screen()
370+
self.in_search_mode = False
368371
return key
369372
return_value = super().keypress(size, key)
370-
_, self.focus_index_before_search = self.log.get_focus()
373+
if not self.in_search_mode:
374+
_, self.focus_index_before_search = self.log.get_focus()
371375
return return_value
372376

373377

0 commit comments

Comments
 (0)