From 183b7f701734661806007a6d539f44a6e3c8f5d8 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Tue, 8 May 2018 23:16:10 +0200 Subject: [PATCH] [git completions] Complete deleted files after "--" for "reset" --- share/completions/git.fish | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/share/completions/git.fish b/share/completions/git.fish index 8e4c7e1b0..c6d4d243f 100644 --- a/share/completions/git.fish +++ b/share/completions/git.fish @@ -1080,9 +1080,10 @@ complete -f -c git -n '__fish_git_using_command reset' -l hard -d 'Reset files i complete -c git -n '__fish_git_using_command reset' -a '(__fish_git_branches)' # reset can either undo changes to versioned modified files, # or remove files from the staging area. -# TODO: Deleted files seem to need a "--" separator. -complete -f -c git -n '__fish_git_using_command reset' -a '(__fish_git_files all-staged modified)' -complete -f -c git -n '__fish_git_using_command reset' -a '(__fish_git_reflog)' -d 'Reflog' +# Deleted files seem to need a "--" separator. +complete -f -c git -n '__fish_git_using_command reset; and not contains -- -- (commandline -op)' -a '(__fish_git_files all-staged modified)' +complete -f -c git -n '__fish_git_using_command reset; and contains -- -- (commandline -op)' -a '(__fish_git_files all-staged deleted modified)' +complete -f -c git -n '__fish_git_using_command reset; and not contains -- -- (commandline -op)' -a '(__fish_git_reflog)' -d 'Reflog' # TODO options ### revert