Can also quit with the escape key.
- Also removed unnecessary color from the help docs.
This commit is contained in:
parent
0170d24abb
commit
1d3e44f7ad
3 changed files with 30 additions and 30 deletions
|
|
@ -71,18 +71,18 @@ Options:
|
|||
KEYS_DOC = """Keys:
|
||||
arrow keys, page up/down, mouse - Move the cursor or scroll the result pane.
|
||||
tab - Change the focus between summary and result pane.
|
||||
*h - Show the help screen. (toggle)
|
||||
*q - Quit.
|
||||
*o - Orient the result pane as portrait or landscape. (toggle)
|
||||
*l - Show the activity log. (toggle)
|
||||
*e - Edit the current file with an editor defined by -e, $EDITOR or $VISUAL.
|
||||
*n - Move to the next issue.
|
||||
*N - Move to the next issue of the current tool.
|
||||
*s - Sort files by type, or by directory location. (toggle)
|
||||
*r - Refresh the currently selected report.
|
||||
*R - Refresh all reports of the current tool.
|
||||
*f - Resize the focused pane to the full screen. (toggle)
|
||||
*x - Open the current file with xdg-open.
|
||||
q, esc - Quit.
|
||||
h - Show the help screen. (toggle)
|
||||
o - Orient the result pane as portrait or landscape. (toggle)
|
||||
l - Show the activity log. (toggle)
|
||||
e - Edit the current file with an editor defined by -e, $EDITOR or $VISUAL.
|
||||
n - Move to the next issue.
|
||||
N - Move to the next issue of the current tool.
|
||||
s - Sort files by type, or by directory location. (toggle)
|
||||
r - Refresh the currently selected report.
|
||||
R - Refresh all reports of the current tool.
|
||||
f - Resize the focused pane to the full screen. (toggle)
|
||||
x - Open the current file with xdg-open.
|
||||
"""
|
||||
|
||||
|
||||
|
|
@ -635,8 +635,7 @@ class Help:
|
|||
def __init__(self, summary, screen):
|
||||
self.summary = summary
|
||||
self.screen = screen
|
||||
keys_doc = highlight_chars(KEYS_DOC, Log._GREEN_STYLE)
|
||||
help_text = fill3.join("\n", [__doc__, keys_doc, get_status_help()])
|
||||
help_text = fill3.join("\n", [__doc__, KEYS_DOC, get_status_help()])
|
||||
self.view = fill3.View.from_widget(fill3.Text(help_text))
|
||||
self.widget = fill3.Border(self.view, title="Help")
|
||||
portal = self.view.portal
|
||||
|
|
@ -644,7 +643,7 @@ class Help:
|
|||
terminal.DOWN_KEY: portal.scroll_down,
|
||||
terminal.LEFT_KEY: portal.scroll_left,
|
||||
terminal.RIGHT_KEY: portal.scroll_right,
|
||||
"q": self._exit_help}
|
||||
"q": self._exit_help, terminal.ESC: self._exit_help}
|
||||
|
||||
def _exit_help(self):
|
||||
self.screen._is_help_visible = False
|
||||
|
|
@ -1044,8 +1043,9 @@ class Screen:
|
|||
terminal.PAGE_UP_KEY: cursor_page_up, "s": toggle_order,
|
||||
terminal.HOME_KEY: cursor_home, terminal.END_KEY: cursor_end,
|
||||
"n": move_to_next_issue, "N": move_to_next_issue_of_tool,
|
||||
"e": edit_file, "q": quit_, "r": refresh, "R": refresh_tool,
|
||||
"\t": toggle_focus, "f": toggle_fullscreen, "x": xdg_open}
|
||||
"e": edit_file, "q": quit_, terminal.ESC: quit_, "r": refresh,
|
||||
"R": refresh_tool, "\t": toggle_focus, "f": toggle_fullscreen,
|
||||
"x": xdg_open}
|
||||
|
||||
|
||||
def setup_inotify(root_path, loop, on_filesystem_event, exclude_filter):
|
||||
|
|
|
|||
|
|
@ -522,7 +522,7 @@ class _Screen:
|
|||
return self.content.appearance(dimensions)
|
||||
|
||||
def on_keyboard_input(self, term_code):
|
||||
if term_code == "q":
|
||||
if term_code in ["q", terminal.ESC]:
|
||||
asyncio.get_event_loop().stop()
|
||||
else:
|
||||
self.content = Filler(Text(repr(term_code)))
|
||||
|
|
|
|||
|
|
@ -12,18 +12,18 @@
|
|||
│Keys: │
|
||||
│ arrow keys, page up/down, mouse - Move the cursor or scroll the result pane. │
|
||||
│ tab - Change the focus between summary and result pane. │
|
||||
│ [m[38;2;0;255;0m[48;2;0;0;0mh[m[38;2;255;255;255m[48;2;0;0;0m - Show the help screen. (toggle) │
|
||||
│ [m[38;2;0;255;0m[48;2;0;0;0mq[m[38;2;255;255;255m[48;2;0;0;0m - Quit. │
|
||||
│ [m[38;2;0;255;0m[48;2;0;0;0mo[m[38;2;255;255;255m[48;2;0;0;0m - Orient the result pane as portrait or landscape. (toggle) │
|
||||
│ [m[38;2;0;255;0m[48;2;0;0;0ml[m[38;2;255;255;255m[48;2;0;0;0m - Show the activity log. (toggle) │
|
||||
│ [m[38;2;0;255;0m[48;2;0;0;0me[m[38;2;255;255;255m[48;2;0;0;0m - Edit the current file with an editor defined by -e, $EDITOR or $VISUAL. │
|
||||
│ [m[38;2;0;255;0m[48;2;0;0;0mn[m[38;2;255;255;255m[48;2;0;0;0m - Move to the next issue. │
|
||||
│ [m[38;2;0;255;0m[48;2;0;0;0mN[m[38;2;255;255;255m[48;2;0;0;0m - Move to the next issue of the current tool. │
|
||||
│ [m[38;2;0;255;0m[48;2;0;0;0ms[m[38;2;255;255;255m[48;2;0;0;0m - Sort files by type, or by directory location. (toggle) │
|
||||
│ [m[38;2;0;255;0m[48;2;0;0;0mr[m[38;2;255;255;255m[48;2;0;0;0m - Refresh the currently selected report. │
|
||||
│ [m[38;2;0;255;0m[48;2;0;0;0mR[m[38;2;255;255;255m[48;2;0;0;0m - Refresh all reports of the current tool. │
|
||||
│ [m[38;2;0;255;0m[48;2;0;0;0mf[m[38;2;255;255;255m[48;2;0;0;0m - Resize the focused pane to the full screen. (toggle) │
|
||||
│ [m[38;2;0;255;0m[48;2;0;0;0mx[m[38;2;255;255;255m[48;2;0;0;0m - Open the current file with xdg-open. │
|
||||
│ q, esc - Quit. │
|
||||
│ h - Show the help screen. (toggle) │
|
||||
│ o - Orient the result pane as portrait or landscape. (toggle) │
|
||||
│ l - Show the activity log. (toggle) │
|
||||
│ e - Edit the current file with an editor defined by -e, $EDITOR or $VISUAL. │
|
||||
│ n - Move to the next issue. │
|
||||
│ N - Move to the next issue of the current tool. │
|
||||
│ s - Sort files by type, or by directory location. (toggle) │
|
||||
│ r - Refresh the currently selected report. │
|
||||
│ R - Refresh all reports of the current tool. │
|
||||
│ f - Resize the focused pane to the full screen. (toggle) │
|
||||
│ x - Open the current file with xdg-open. │
|
||||
│ │
|
||||
│Statuses: │
|
||||
│ [m[38;2;255;255;255m[48;2;80;80;80m [m[38;2;255;255;255m[48;2;0;0;0m Normal │
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue