Skip to content

Commit 77a6f0d

Browse files
committed
boxes: Improve error message for invalid stream name.
Now that autocomplete for stream box has been added, we can show a hint to use autocomplete when the user inputs an invalid stream name.
1 parent b3b7a40 commit 77a6f0d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

zulipterminal/ui_tools/boxes.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,13 @@ def keypress(self, size: urwid_Size, key: str) -> Optional[str]:
319319
if header.focus_col == 0:
320320
stream_name = header[0].edit_text
321321
if not self.model.is_valid_stream(stream_name):
322-
self.view.set_footer_text("Invalid stream name", 3)
322+
invalid_stream_error = (
323+
'Invalid stream name.'
324+
' Use {} or {} to autocomplete.'
325+
.format(keys_for_command('AUTOCOMPLETE').pop(),
326+
keys_for_command('AUTOCOMPLETE_REVERSE').pop())
327+
)
328+
self.view.set_footer_text(invalid_stream_error, 3)
323329
return key
324330
user_ids = self.model.get_other_subscribers_in_stream(
325331
stream_name=stream_name)

0 commit comments

Comments
 (0)