Skip to content

Commit 6fa8295

Browse files
committed
walker: Append path separator to directories
Close #4255
1 parent f975b40 commit 6fa8295

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/reader.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@ func (r *Reader) readFiles(roots []string, opts walkerOpts, ignores []string) bo
320320
return filepath.SkipDir
321321
}
322322
}
323+
path += sep
323324
}
324325
if ((opts.file && !isDir) || (opts.dir && isDir)) && r.pusher(stringBytes(path)) {
325326
atomic.StoreInt32(&r.event, int32(EvtReadNew))

test/test_shell_integration.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def test_alt_c
7373
tmux.prepare
7474
tmux.send_keys :Escape, :c
7575
lines = tmux.until { |lines| assert_operator lines.match_count, :>, 0 }
76-
expected = lines.reverse.find { |l| l.start_with?('> ') }[2..]
76+
expected = lines.reverse.find { |l| l.start_with?('> ') }[2..].chomp('/')
7777
tmux.send_keys :Enter
7878
tmux.prepare
7979
tmux.send_keys :pwd, :Enter
@@ -241,7 +241,7 @@ def test_dir_completion
241241
tmux.until do |lines|
242242
assert_equal 1, lines.match_count
243243
assert_includes lines, '> 55'
244-
assert_includes lines, '> /tmp/fzf-test/d55'
244+
assert_includes lines, '> /tmp/fzf-test/d55/'
245245
end
246246
tmux.send_keys :Enter
247247
tmux.until(true) { |lines| assert_equal 'cd /tmp/fzf-test/d55/', lines[-1] }

0 commit comments

Comments
 (0)