mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-12 01:52:31 +01:00
fix(git): git_status_prompt must respects spaces to properly match prefixes
`git_status_prompt` was always empty as whitespace around the keys for `$prefix_constant_map` were trimmed. The in list of the for loop must be enclosed in `"` to avoid trimming, which in return requires the iterator specifier to contain an `@` to avoid concatenation of all keys. This is important for the regex to work properly.
This commit is contained in:
parent
92aed2e936
commit
b6cf913244
1 changed files with 1 additions and 1 deletions
|
|
@ -117,7 +117,7 @@ function _omz_git_prompt_status() {
|
|||
fi
|
||||
|
||||
# For each status prefix, do a regex comparison
|
||||
for status_prefix in ${(k)prefix_constant_map}; do
|
||||
for status_prefix in "${(@k)prefix_constant_map}"; do
|
||||
local status_constant="${prefix_constant_map[$status_prefix]}"
|
||||
local status_regex=$'(^|\n)'"$status_prefix"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue