Skip to content

Commit

Permalink
πŸ› Allow search for single word, like before
Browse files Browse the repository at this point in the history
  • Loading branch information
makew0rld committed Dec 21, 2020
1 parent 9ad3dd8 commit c93d09b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion display/display.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,13 @@ func Init(version, commit, builtBy string) {
} else {
// It's a full URL or search term
// Detect if it's a search or URL
if strings.Contains(query, " ") && !hasSpaceisURL.MatchString(query) {
if (strings.Contains(query, " ") && !hasSpaceisURL.MatchString(query)) ||
(!strings.HasPrefix(query, "//") && !strings.Contains(query, "://") &&
!strings.Contains(query, ".")) {
// Has a space and follows regex, OR
// doesn't start with "//", contain "://", and doesn't have a dot either.
// Then it's a search

u := viper.GetString("a-general.search") + "?" + gemini.QueryEscape(query)
cache.RemovePage(u) // Don't use the cached version of the search
URL(u)
Expand Down

0 comments on commit c93d09b

Please sign in to comment.