mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-04 10:57:50 +08:00
Trivial cleanup.
This commit is contained in:
parent
a657a2989a
commit
bb1078d002
|
@ -2,7 +2,6 @@ package edit
|
|||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path"
|
||||
"sort"
|
||||
"strings"
|
||||
|
@ -12,7 +11,8 @@ import (
|
|||
"github.com/elves/elvish/util"
|
||||
)
|
||||
|
||||
// A completer takes the current node
|
||||
// A completer takes the current Node and an Editor and returns a list of
|
||||
// candidates. the Node is always a leaf in the parsed AST.
|
||||
type completer func(parse.Node, *Editor) []*candidate
|
||||
|
||||
var completers = []struct {
|
||||
|
@ -193,8 +193,3 @@ func complArgInner(head string, ed *Editor, formHead bool) []*candidate {
|
|||
func dotfile(fname string) bool {
|
||||
return strings.HasPrefix(fname, ".")
|
||||
}
|
||||
|
||||
func isDir(fname string) bool {
|
||||
stat, err := os.Stat(fname)
|
||||
return err == nil && stat.IsDir()
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package edit
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/elves/elvish/eval"
|
||||
"github.com/elves/elvish/parse"
|
||||
"github.com/elves/elvish/util"
|
||||
|
@ -47,3 +49,8 @@ func init() {
|
|||
isBuiltinSpecial[name] = true
|
||||
}
|
||||
}
|
||||
|
||||
func isDir(fname string) bool {
|
||||
stat, err := os.Stat(fname)
|
||||
return err == nil && stat.IsDir()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user