]> git.lizzy.rs Git - micro.git/commitdiff
Fix cycleback in infopane
authorZachary Yedidia <zyedidia@gmail.com>
Sun, 2 Feb 2020 21:16:53 +0000 (16:16 -0500)
committerZachary Yedidia <zyedidia@gmail.com>
Sun, 2 Feb 2020 21:16:53 +0000 (16:16 -0500)
internal/action/actions.go
internal/action/infopane.go

index 7efb8135a4f6938b71dee41fa9b42de1c2742d45..4aeba6f3b51e08847745728247ac19959a3bd77e 100644 (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
index acff35972efba4d60651e2f807fcdf98731bedc2..9c137c52de3b8cb3f07511e40cc52a55b7cc8d4e 100644 (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