fix: minor change
This commit is contained in:
parent
4b775101c8
commit
f6bb6789f6
1 changed files with 6 additions and 2 deletions
|
@ -143,7 +143,11 @@ func (c *Cli) GroupsBox() string {
|
||||||
case "q", "<C-c>", "<Escape>":
|
case "q", "<C-c>", "<Escape>":
|
||||||
return ""
|
return ""
|
||||||
case "<Enter>":
|
case "<Enter>":
|
||||||
return l.Rows[l.SelectedRow]
|
if len(l.Rows) == 0 {
|
||||||
|
return ""
|
||||||
|
} else {
|
||||||
|
return l.Rows[l.SelectedRow]
|
||||||
|
}
|
||||||
case "j", "<Down>":
|
case "j", "<Down>":
|
||||||
if len(l.Rows) > 0 {
|
if len(l.Rows) > 0 {
|
||||||
l.ScrollDown()
|
l.ScrollDown()
|
||||||
|
@ -292,7 +296,7 @@ func (c *Cli) ListEntries(ch chan<- bool) {
|
||||||
ui.Clear()
|
ui.Clear()
|
||||||
}
|
}
|
||||||
|
|
||||||
if index >= 0 {
|
if len(entries) > 0 && index >= 0 && index < len(entries) {
|
||||||
c.EntryBox(entries[index])
|
c.EntryBox(entries[index])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue