Skip to content

Commit 508898a

Browse files
committed
Simplified a logic condition to prevent double checking
Also: - Clarified a parameter description to document how to accept fish-shell style auto-suggestions
1 parent 0ddfaaa commit 508898a

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

cmd2/cmd2.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,8 @@ def __init__(
395395
instantiate and register all commands. If False, CommandSets
396396
must be manually installed with `register_command_set`.
397397
:param auto_suggest: If True, cmd2 will provide fish shell style auto-suggestions
398-
based on history. If False, these will not be provided.
398+
based on history. User can press right-arrow key to accept the
399+
provided suggestion.
399400
:param bottom_toolbar: if ``True``, then a bottom toolbar will be displayed.
400401
:param command_sets: Provide CommandSet instances to load during cmd2 initialization.
401402
This allows CommandSets with custom constructor parameters to be

cmd2/pt_utils.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,10 @@ def get_completions(self, document: Document, _complete_event: object) -> Iterab
9797
console.print(completions.table, end="", soft_wrap=False)
9898
print_formatted_text(pt_filter_style("\n" + capture.get()))
9999

100-
# Print hint if present and settings say we should
101-
if completions.hint and not completions:
102-
print_formatted_text(pt_filter_style(completions.hint))
103-
104100
if not completions:
101+
# # Print hint if present
102+
if completions.hint:
103+
print_formatted_text(pt_filter_style(completions.hint))
105104
return
106105

107106
# The length of the user's input minus any shortcut.

0 commit comments

Comments
 (0)