]> git.lizzy.rs Git - micro.git/commitdiff
Use filecomplete for shell mode
authorZachary Yedidia <zyedidia@gmail.com>
Tue, 18 Feb 2020 03:29:33 +0000 (22:29 -0500)
committerZachary Yedidia <zyedidia@gmail.com>
Tue, 18 Feb 2020 03:29:33 +0000 (22:29 -0500)
internal/action/infopane.go

index 3a4663511dbbd461a9d03a1d2ca3c39937dd5c09..3d3e5570eb8dd2fb6e222900a63ca4cefe3132cc 100644 (file)
@@ -4,6 +4,7 @@ import (
        "bytes"
        "strings"
 
+       "github.com/zyedidia/micro/internal/buffer"
        "github.com/zyedidia/micro/internal/display"
        "github.com/zyedidia/micro/internal/info"
        "github.com/zyedidia/micro/internal/util"
@@ -186,14 +187,16 @@ func (h *InfoPane) Autocomplete() {
        args := bytes.Split(l, []byte{' '})
        cmd := string(args[0])
 
-       if len(args) == 1 {
-               b.Autocomplete(CommandComplete)
-       } else {
-               if action, ok := commands[cmd]; ok {
+       if h.PromptType == "Command" {
+               if len(args) == 1 {
+                       b.Autocomplete(CommandComplete)
+               } else if action, ok := commands[cmd]; ok {
                        if action.completer != nil {
                                b.Autocomplete(action.completer)
                        }
                }
+       } else if h.PromptType == "Shell" {
+               b.Autocomplete(buffer.FileComplete)
        }
 }