summaryrefslogtreecommitdiff
path: root/src/reader.go
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2015-01-12 12:56:17 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2015-01-12 12:56:17 +0900
commitcd847affb79ea6438c9721635724efc6f58e2215 (patch)
treed1e631e3dca8832ee4c495924789f6697c3629cf /src/reader.go
parent7a2bc2cada971c7a390d09b0afda34780ff56fb6 (diff)
downloadfzf-cd847affb79ea6438c9721635724efc6f58e2215.tar.gz
Reorganize source code
Diffstat (limited to 'src/reader.go')
-rw-r--r--src/reader.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/reader.go b/src/reader.go
index 269a2fdc..2c10b8aa 100644
--- a/src/reader.go
+++ b/src/reader.go
@@ -1,13 +1,12 @@
package fzf
-// #include <unistd.h>
-import "C"
-
import (
"bufio"
"io"
"os"
"os/exec"
+
+ "github.com/junegunn/fzf/src/util"
)
const defaultCommand = `find * -path '*/\.*' -prune -o -type f -print -o -type l -print 2> /dev/null`
@@ -15,12 +14,12 @@ const defaultCommand = `find * -path '*/\.*' -prune -o -type f -print -o -type l
// Reader reads from command or standard input
type Reader struct {
pusher func(string)
- eventBox *EventBox
+ eventBox *util.EventBox
}
// ReadSource reads data from the default command or from standard input
func (r *Reader) ReadSource() {
- if int(C.isatty(C.int(os.Stdin.Fd()))) != 0 {
+ if util.IsTty() {
cmd := os.Getenv("FZF_DEFAULT_COMMAND")
if len(cmd) == 0 {
cmd = defaultCommand