Skip to content

Commit de2ffbe

Browse files
authored
🔀 Merge pull request #32 from davep/all-the-suggestions
Always suggest all history and all possible commands
2 parents 4f0f9d3 + 0c94f36 commit de2ffbe

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/hike/widgets/command_line/widget.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,15 @@ def _history_suggester(self) -> SuggestFromList:
156156
be used.
157157
"""
158158
return SuggestFromList(
159-
reversed(list(self.history))
160-
if self.history
161-
else chain(*(command.suggestions() for command in COMMANDS))
159+
[
160+
# Start off with the history, with the most recently-used
161+
# commands first so suggestions come from the thing
162+
# most-recently done.
163+
*reversed(list(self.history)),
164+
# Tack known commands on the end; this means that the user
165+
# will get prompted for commands they've not used yet.
166+
*chain(*(command.suggestions() for command in COMMANDS)),
167+
]
162168
)
163169

164170
def compose(self) -> ComposeResult:

0 commit comments

Comments
 (0)