Add shift-tab bind for completion

This commit is contained in:
Oliver Blanthorn 2017-11-24 19:00:26 +00:00
parent 535c79532b
commit a76f052042
No known key found for this signature in database
GPG key ID: 2BB8C36BB504BFF3

View file

@ -55,10 +55,14 @@ export abstract class CompletionSource {
return this._state
}
next(forward = true): boolean {
next(inc = 1): boolean {
return false
}
prev(inc = 1): boolean {
return this.next(-1*inc)
}
}
// Default classes
@ -294,17 +298,16 @@ abstract class CompletionSourceFuse extends CompletionSource {
/* console.log('results', result1, res2) */
}
next(forward=true){
next(inc=1){
if (this.state != "hidden"){
let visopts = this.options.filter((o) => o.state != "hidden")
let currind = visopts.findIndex((o) => o.state == "focused")
this.deselect()
this.select(visopts[currind + 1])
this.select(visopts[currind + inc])
return true
} else return false
}
prev = () => this.next(false)
}
// }}}