Skip to content

Commit

Permalink
return full history when substring searching on an empty string
Browse files Browse the repository at this point in the history
  • Loading branch information
while-loop committed Jun 23, 2023
1 parent 0128c3d commit fc3bff8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion common.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,11 @@ func (s *State) promptUnsupported(p string) (string, error) {
func (s *State) getHistory(line string) (ph []string) {
switch s.historyMode {
case HistoryModePattern:
ph, _ = s.getHistoryByPattern(line)
if line == "" {
ph = append(ph, s.history...)
} else {
ph, _ = s.getHistoryByPattern(line)
}
return ph
default:
for _, h := range s.history {
Expand Down

0 comments on commit fc3bff8

Please sign in to comment.