mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-05 03:17:50 +08:00
edit/completion: prev and next does nothing when there is no candidate.
This fixes #717.
This commit is contained in:
parent
b24e4a73cc
commit
43e0761ec7
|
@ -181,6 +181,9 @@ func (c *completion) apply(line string, dot int) (string, int) {
|
|||
}
|
||||
|
||||
func (c *completion) prev(cycle bool) {
|
||||
if c.selected == -1 {
|
||||
return
|
||||
}
|
||||
c.selected--
|
||||
if c.selected == -1 {
|
||||
if cycle {
|
||||
|
@ -192,6 +195,9 @@ func (c *completion) prev(cycle bool) {
|
|||
}
|
||||
|
||||
func (c *completion) next(cycle bool) {
|
||||
if c.selected == -1 {
|
||||
return
|
||||
}
|
||||
c.selected++
|
||||
if c.selected == len(c.filtered) {
|
||||
if cycle {
|
||||
|
|
Loading…
Reference in New Issue
Block a user