From bb1078d0025662fc4fd3523d7ae542bc4bed0dc1 Mon Sep 17 00:00:00 2001 From: Qi Xiao Date: Wed, 24 Feb 2016 13:14:02 +0100 Subject: [PATCH] Trivial cleanup. --- edit/completers.go | 9 ++------- edit/stylists.go | 7 +++++++ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/edit/completers.go b/edit/completers.go index 2166f480..c9a68aa7 100644 --- a/edit/completers.go +++ b/edit/completers.go @@ -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() -} diff --git a/edit/stylists.go b/edit/stylists.go index fd3daa58..a1d9ae49 100644 --- a/edit/stylists.go +++ b/edit/stylists.go @@ -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() +}