Fix cycleback in infopane

This commit is contained in:
Zachary Yedidia 2020-02-02 16:16:53 -05:00
parent 6a1b8f4a4f
commit 28ed47e358
2 changed files with 2 additions and 4 deletions

View file

@ -1,7 +1,6 @@
package action
import (
"log"
"regexp"
"runtime"
"strings"
@ -633,11 +632,9 @@ func (h *BufPane) CycleAutocompleteBack() bool {
if h.Cursor.HasSelection() {
return false
}
log.Println(h.Buf.HasSuggestions)
if h.Buf.HasSuggestions {
h.Buf.CycleAutocomplete(false)
log.Println("TRUE")
return true
}
return false

View file

@ -73,6 +73,7 @@ func (h *InfoPane) HandleEvent(event tcell.Event) {
}
}
// DoKeyEvent executes a key event for the command bar, doing any overriden actions
func (h *InfoPane) DoKeyEvent(e KeyEvent) bool {
done := false
if action, ok := BufKeyBindings[e]; ok {
@ -85,7 +86,7 @@ func (h *InfoPane) DoKeyEvent(e KeyEvent) bool {
for s, a := range InfoOverrides {
// TODO this is a hack and really we should have support
// for having binding overrides for different buffers
if strings.Contains(estr, s) {
if strings.HasPrefix(estr, s) {
done = true
a(h)
break