Skip to content

Commit

Permalink
🎈 perf(cd):
Browse files Browse the repository at this point in the history
  • Loading branch information
WAY29 committed May 11, 2022
1 parent 2909784 commit 469720a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/cmd/root/cd.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func CmdCDSuggests(args []string, word string, currentLine string) []prompt.Sugg
for _, suggest := range tooldir.PathSuggests {
restoreSuggests = append(restoreSuggests, suggest.Text)
}
for i := range tooldir.PathSuggests {
for i := 0; i < len(tooldir.PathSuggests); i++ {
pathStringBuilder.WriteString(tempPath)
if !strings.HasSuffix(tempPath, "/") {
pathStringBuilder.WriteString("/")
Expand All @@ -53,7 +53,7 @@ func CmdCDSuggests(args []string, word string, currentLine string) []prompt.Sugg
}

defer func() {
for i := range tooldir.PathSuggests {
for i := 0; i < len(tooldir.PathSuggests); i++ {
tooldir.PathSuggests[i].Text = restoreSuggests[i]
}
}()
Expand Down

0 comments on commit 469720a

Please sign in to comment.