Skip to content

Commit 88bd743

Browse files
Ezio-Sarthakneiljp
authored andcommitted
boxes: Add support for accessing markdown help popup from compose.
This commit adds a keypress event to show the markdown help menu while a user is in the compose area, to help users to check for proper markdown syntax while writing a message. This is a fuller fix to zulip#623. Test added.
1 parent d44ee9c commit 88bd743

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

tests/ui_tools/test_boxes.py

+8
Original file line numberDiff line numberDiff line change
@@ -1260,6 +1260,14 @@ def focus_val(x: str) -> int:
12601260
expected_focus_col_name
12611261
)
12621262

1263+
@pytest.mark.parametrize("key", keys_for_command("MARKDOWN_HELP"))
1264+
def test_keypress_MARKDOWN_HELP(self, mocker, write_box, key, widget_size):
1265+
size = widget_size(write_box)
1266+
1267+
write_box.keypress(size, key)
1268+
1269+
write_box.view.controller.show_markdown_help.assert_called_once_with()
1270+
12631271
@pytest.mark.parametrize(
12641272
"msg_type, expected_box_size",
12651273
[

zulipterminal/ui_tools/boxes.py

+3
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,9 @@ def keypress(self, size: urwid_Size, key: str) -> Optional[str]:
677677
self.view.controller.exit_editor_mode()
678678
self.main_view(False)
679679
self.view.middle_column.set_focus("body")
680+
elif is_command_key("MARKDOWN_HELP", key):
681+
self.view.controller.show_markdown_help()
682+
return key
680683
elif is_command_key("SAVE_AS_DRAFT", key):
681684
if self.msg_edit_state is None:
682685
if self.to_write_box:

0 commit comments

Comments
 (0)