-
Notifications
You must be signed in to change notification settings - Fork 618
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Draw comment text in help view in alignment
Add code to align comment text when shown in the help screen. Comment text are drawn on the right-hand side of an 'action' field. Only key bindings with comment text will participate in calculating the field width; key bindings with no comments but with unusually long action names may overflow the field. 1. keys.h Add run_request.name field, analogous to req_info.name field. 2. keys.c a. add_run_request() Load run_request.name with a displayable version of **argv, using new function argv_to_string_alloc_prefix(). Include run_request.flags as a string prefix. 3. help.c a. help_keys_visitor() If run_request.help text is present, update help_state.name_width with strlen(run_request.name), so that drawing run_request.help will be aligned. b. help_draw() Analogous to drawing req_info.name as a LINE_HELP_ACTION, draw run_request.name using draw_field(), which replaces the current method of drawing **argv using draw_formatted(). We do this only if run_request.help text is present, otherwise, we draw run_request.name as free-form text.
- Loading branch information
1 parent
557b020
commit 9370f51
Showing
3 changed files
with
21 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters