mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-19 18:01:15 -03:00
__fish_complete_directories: Remove --foo= from token
Otherwise this would complete `git --exec-path=foo`, by running `complete -C"'' --exec-path=foo"`, which would print "--exec-path=foo", and so it would end as `git --exec-path=--exec-path=foo` because the "replaces token" bit was lost. I'm not sure how to solve it cleanly - maybe an additional option to `complete`? Anyway, for now this Fixes #9538.
This commit is contained in:
@@ -9,7 +9,11 @@ function __fish_complete_directories -d "Complete directory prefixes" --argument
|
||||
end
|
||||
|
||||
if not set -q comp[1]
|
||||
set comp (commandline -ct)
|
||||
# No token given, so we use the current commandline token.
|
||||
# If we have a --name=val option, we need to remove it,
|
||||
# or the complete -C below would keep it, and then whatever complete
|
||||
# called us would add it again (assuming it's in the current token)
|
||||
set comp (commandline -ct | string replace -r -- '^-[^=]*=' '' $comp)
|
||||
end
|
||||
|
||||
# HACK: We call into the file completions by using an empty command
|
||||
|
||||
Reference in New Issue
Block a user