Skip to content

Commit e35ebfb

Browse files
committed
messages: Show headers if is_search_narrow().
Previously, when text searching, messages appear adjacently under the same heading, this can be confusing since they appear sequentially but there may be messages inbetween that don't meet the search criteria. Fixes part of zulip#1550.
1 parent 0902171 commit e35ebfb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

zulipterminal/ui_tools/messages.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,14 @@ def need_recipient_header(self) -> bool:
120120
return False
121121
if len(self.model.narrow) == 2 and self.model.narrow[1][0] == "topic":
122122
return False
123+
123124
if self.model.is_search_narrow():
124-
return True
125+
if len(self.model.narrow) == 1:
126+
return True
127+
if len(self.model.narrow) == 2:
128+
return not self.message["type"] == "private"
129+
if len(self.model.narrow) == 3:
130+
return not self.model.narrow[1][0] == "topic"
125131

126132
last_msg = self.last_message
127133
if self.message["type"] == "stream":

0 commit comments

Comments
 (0)