summaryrefslogtreecommitdiff
path: root/src/reader.go
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2024-07-05 20:15:03 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2024-07-05 20:15:03 +0900
commit8f4c23f1c454a1f5f3e3ca1479227ee5186f8212 (patch)
treea9d4205761297d974f3e52eb995f37e69c254a07 /src/reader.go
parent23a391e71599fadb780b53f716c86d5aec07e1d8 (diff)
downloadfzf-8f4c23f1c454a1f5f3e3ca1479227ee5186f8212.tar.gz
Remove --walker-path-sep
Related: #3859 #3907 #3909
Diffstat (limited to 'src/reader.go')
-rw-r--r--src/reader.go17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/reader.go b/src/reader.go
index 9d4fe160..9d4b2f46 100644
--- a/src/reader.go
+++ b/src/reader.go
@@ -111,7 +111,7 @@ func (r *Reader) readChannel(inputChan chan string) bool {
}
// ReadSource reads data from the default command or from standard input
-func (r *Reader) ReadSource(inputChan chan string, root string, opts walkerOpts, ignores []string, sep byte) {
+func (r *Reader) ReadSource(inputChan chan string, root string, opts walkerOpts, ignores []string) {
r.startEventPoller()
var success bool
if inputChan != nil {
@@ -119,7 +119,7 @@ func (r *Reader) ReadSource(inputChan chan string, root string, opts walkerOpts,
} else if util.IsTty(os.Stdin) {
cmd := os.Getenv("FZF_DEFAULT_COMMAND")
if len(cmd) == 0 {
- success = r.readFiles(root, opts, ignores, sep)
+ success = r.readFiles(root, opts, ignores)
} else {
// We can't export FZF_* environment variables to the default command
success = r.readFromCommand(cmd, nil)
@@ -233,10 +233,9 @@ func isSymlinkToDir(path string, de os.DirEntry) bool {
return false
}
-func (r *Reader) readFiles(root string, opts walkerOpts, ignores []string, sep byte) bool {
+func (r *Reader) readFiles(root string, opts walkerOpts, ignores []string) bool {
r.killed = false
conf := fastwalk.Config{Follow: opts.follow}
- replaceSep := sep != os.PathSeparator
fn := func(path string, de os.DirEntry, err error) error {
if err != nil {
return nil
@@ -255,15 +254,7 @@ func (r *Reader) readFiles(root string, opts walkerOpts, ignores []string, sep b
}
}
}
- bytes := stringBytes(path)
- if replaceSep {
- for i, b := range bytes {
- if b == os.PathSeparator {
- bytes[i] = sep
- }
- }
- }
- if ((opts.file && !isDir) || (opts.dir && isDir)) && r.pusher(bytes) {
+ if ((opts.file && !isDir) || (opts.dir && isDir)) && r.pusher(stringBytes(path)) {
atomic.StoreInt32(&r.event, int32(EvtReadNew))
}
}