Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions functions/_fifc_source_files.fish
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ function _fifc_source_files -d "Return a command to recursively find files"
else if test "$raw_path" = "."
echo "fd . $fifc_fd_opts --color=always --hidden $fd_custom_opts"
else if test -n "$hidden"
echo "fd . $fifc_fd_opts --color=always --hidden -- $escaped_path | string replace --regex -- \"$home_re\" '~'"
# Explicitly-typed path: reveal gitignored entries (bare completion still respects .gitignore)
echo "fd . $fifc_fd_opts --color=always --no-ignore-vcs --hidden -- $escaped_path | string replace --regex -- \"$home_re\" '~'"
else
echo "fd . $fifc_fd_opts --color=always -- $escaped_path | string replace --regex -- \"$home_re\" '~'"
# Explicitly-typed path: reveal gitignored entries (bare completion still respects .gitignore)
echo "fd . $fifc_fd_opts --color=always --no-ignore-vcs -- $escaped_path | string replace --regex -- \"$home_re\" '~'"
end
else if test -n "$hidden"
# Use sed to strip cwd prefix
Expand Down
23 changes: 23 additions & 0 deletions tests/test_source_files.fish
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,29 @@ set actual (_fifc_source_files)
@test "source files cwd with spaces" "$actual" = "fd . --type f --color=always --strip-cwd-prefix"

cd "$curr_pwd"

# An explicitly-typed subdirectory bypasses gitignore so its ignored entries appear.
set fifc_fd_opts
set fifc_query
set fifc_token docs/
set typed (_fifc_source_files)
if string match --quiet -- "*--no-ignore-vcs*" "$typed"
set has_no_ignore yes
else
set has_no_ignore no
end
@test "source files typed path bypasses gitignore" "$has_no_ignore" = yes

# Bare completion keeps respecting gitignore (no unignore flag).
set fifc_token ""
set bare (_fifc_source_files)
if string match --quiet -- "*--no-ignore*" "$bare"
set bare_no_ignore yes
else
set bare_no_ignore no
end
@test "source files bare completion respects gitignore" "$bare_no_ignore" = no

set fifc_fd_opts $curr_fifc_fd_opts
set fifc_query $curr_fifc_query
set fifc_token $curr_fifc_token
Loading