mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-29 22:27:13 +09:00
Use filecomplete for shell mode
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/zyedidia/micro/internal/buffer"
|
||||||
"github.com/zyedidia/micro/internal/display"
|
"github.com/zyedidia/micro/internal/display"
|
||||||
"github.com/zyedidia/micro/internal/info"
|
"github.com/zyedidia/micro/internal/info"
|
||||||
"github.com/zyedidia/micro/internal/util"
|
"github.com/zyedidia/micro/internal/util"
|
||||||
@@ -186,14 +187,16 @@ func (h *InfoPane) Autocomplete() {
|
|||||||
args := bytes.Split(l, []byte{' '})
|
args := bytes.Split(l, []byte{' '})
|
||||||
cmd := string(args[0])
|
cmd := string(args[0])
|
||||||
|
|
||||||
if len(args) == 1 {
|
if h.PromptType == "Command" {
|
||||||
b.Autocomplete(CommandComplete)
|
if len(args) == 1 {
|
||||||
} else {
|
b.Autocomplete(CommandComplete)
|
||||||
if action, ok := commands[cmd]; ok {
|
} else if action, ok := commands[cmd]; ok {
|
||||||
if action.completer != nil {
|
if action.completer != nil {
|
||||||
b.Autocomplete(action.completer)
|
b.Autocomplete(action.completer)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else if h.PromptType == "Shell" {
|
||||||
|
b.Autocomplete(buffer.FileComplete)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user