Trivial cleanup.

This commit is contained in:
Qi Xiao 2016-02-24 13:14:02 +01:00
parent a657a2989a
commit bb1078d002
2 changed files with 9 additions and 7 deletions

View File

@ -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()
}

View File

@ -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()
}