mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-29 06:13:20 +00:00
completions/git: forward a ./-prefix from the command line
"git add ./" shows only hidden files (if at all). It should show all files that can be added. The problem is that candidates come from "git status" which prints clean relative paths. Let's allow some unclean paths. This is far from a complete fix but it should work for the common scenario. Observe that wildcard_complete_internal() actually filters out all non-hidden files, if the query is `./`. Closes #9091
This commit is contained in:
parent
a447cc38a9
commit
88d1317eaa
1 changed files with 6 additions and 2 deletions
|
@ -334,8 +334,12 @@ function __fish_git_files
|
|||
# If this contains newlines or tabs,
|
||||
# there is nothing we can do, but that's a general issue with scripted completions.
|
||||
set file (string trim -c \" -- $file)
|
||||
# First the relative filename.
|
||||
# The relative filename.
|
||||
if string match -q './*' -- (commandline -ct)
|
||||
printf './%s\t%s\n' $file $d
|
||||
else
|
||||
printf '%s\t%s\n' "$file" $d
|
||||
end
|
||||
# Now from repo root.
|
||||
# Only do this if the filename isn't a simple child,
|
||||
# or the current token starts with ":"
|
||||
|
|
Loading…
Reference in a new issue