Skip to content

Commit

Permalink
If no entry found on the initial search, return nil
Browse files Browse the repository at this point in the history
  • Loading branch information
cgxeiji committed Nov 4, 2018
1 parent 2b07ae1 commit d9047e4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scholar/cmd/gui.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
"github.com/spf13/viper"
)

var helpString = " /: search, space: biblatex, enter: open, q: quit, ^c: exit "
var helpString = " /: search, space: cite, enter: select, q: quit, ^c: exit "
var showList []*scholar.Entry

func guiQuery(entries []*scholar.Entry, search string) *scholar.Entry {
Expand Down Expand Up @@ -150,6 +150,7 @@ func guiQuery(entries []*scholar.Entry, search string) *scholar.Entry {
found := guiSearch(search, entries, searcher)
switch len(found) {
case 0:
return gocui.ErrQuit
case 1:
selEntryCh <- found[0]
return gocui.ErrQuit
Expand Down

0 comments on commit d9047e4

Please sign in to comment.