diff options
author | Daniel Shahaf <d.s@daniel.shahaf.name> | 2020-06-26 18:06:40 +0000 |
---|---|---|
committer | Daniel Shahaf <d.s@daniel.shahaf.name> | 2020-06-28 13:01:09 +0000 |
commit | 5584badbea3ffe2d25ef11cc7d4b138d10a867b8 (patch) | |
tree | 9895dd7c2fc85b24f706e33586c75f8b512056a4 | |
parent | c1c1fb9b2c39757e210bd047ceee97d8d91ed3f8 (diff) | |
download | zsh-5584badbea3ffe2d25ef11cc7d4b138d10a867b8.tar.gz zsh-5584badbea3ffe2d25ef11cc7d4b138d10a867b8.tar.xz zsh-5584badbea3ffe2d25ef11cc7d4b138d10a867b8.zip |
46129: _git-config: Fix a bug where a second trailing dot would be incorrectly offered.
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | Completion/Unix/Command/_git | 6 |
2 files changed, 4 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog index b0193b2a8..238cd49d0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2020-06-28 Daniel Shahaf <d.s@daniel.shahaf.name> + * 46129: Completion/Unix/Command/_git: _git-config: Fix a bug + where a second trailing dot would be incorrectly offered. + * 46130: Completion/Unix/Command/_git: _git-config: Complete some more options. diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index d8e1743b5..f33ccf35a 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -3025,11 +3025,7 @@ __git_config_option-or-value () { local opt declare -a match mbegin mend for opt in ${${${${(M)git_options:#(#i)${IPREFIX}[^.:]##:*}#(#i)${IPREFIX}}/#(#b)([^:]##:)([^\\:]#(\\?[^\\:]#)#:[^\\:]#(\\?[^\\:]#)#:->bool)/$match[1]whether or not to $match[2]}/#(#b)([^:]##:([^\\:]#(\\?[^\\:]#)#))*/$match[1]}; do - # TODO: Completing the option names 'core.splitIndex' or 'grep.column' - # offers a second, trailing dot, because there are also options - # called 'splitIndex.foo' and 'column.bar' (some of them are - # added to $git_options as "unknown option name"). - if (( ${git_options[(I)${opt%%:*}.*]} )); then + if (( ${git_options[(I)${IPREFIX}${opt%%:*}.*]} )); then sections_and_options+=$opt else options+=$opt |