[git-info] Document that flag (e) is needed
so proper expansion of ref names occurs, due to changes done in 53a3cd7
.
This commit is contained in:
parent
5b90c96cd1
commit
21696a4f70
2 changed files with 10 additions and 10 deletions
|
@ -27,8 +27,8 @@ also untracked files. It can be enabled with the following zstyle:
|
||||||
|
|
||||||
zstyle ':zim:git-info' verbose yes
|
zstyle ':zim:git-info' verbose yes
|
||||||
|
|
||||||
In non-verbose mode, the 'untracked' context is not available (see Main
|
In non-verbose mode, the 'untracked' context is not available (see *Main
|
||||||
Contexts below), and untracked files are also not considered for computing the
|
contexts* below), and untracked files are also not considered for computing the
|
||||||
'dirty' context. Using `git status` to check for untracked files can be
|
'dirty' context. Using `git status` to check for untracked files can be
|
||||||
[expensive](https://gist.github.com/sindresorhus/3898739).
|
[expensive](https://gist.github.com/sindresorhus/3898739).
|
||||||
|
|
||||||
|
@ -44,8 +44,8 @@ a style is:
|
||||||
### Main contexts
|
### Main contexts
|
||||||
|
|
||||||
| Name | Code | Description
|
| Name | Code | Description
|
||||||
| --------- | :----: | --------------------------------------------------------
|
| --------- | :----: | ---------------------------------------------------------
|
||||||
| action | %s | Special action name (see Special Action Contexts below)
|
| action | %s | Special action name (see *Special action contexts* below)
|
||||||
| ahead | %A | Commits ahead of remote count
|
| ahead | %A | Commits ahead of remote count
|
||||||
| behind | %B | Commits behind of remote count
|
| behind | %B | Commits behind of remote count
|
||||||
| diverged | %V | Diverged commits (both ahead and behind are yield when it's not defined)
|
| diverged | %V | Diverged commits (both ahead and behind are yield when it's not defined)
|
||||||
|
@ -68,7 +68,7 @@ when an actual branch is checked out (so when **not** in 'detached HEAD' state).
|
||||||
### Special action contexts
|
### Special action contexts
|
||||||
|
|
||||||
| Name | Format | Default Value
|
| Name | Format | Default Value
|
||||||
| --------------------------- | :-----: | -------------------------------------
|
| --------------------------- | :-----: | --------------------------------------
|
||||||
| action:apply | value | 'apply'
|
| action:apply | value | 'apply'
|
||||||
| action:bisect | value | 'bisect'
|
| action:bisect | value | 'bisect'
|
||||||
| action:cherry-pick | value | 'cherry-pick'
|
| action:cherry-pick | value | 'cherry-pick'
|
||||||
|
@ -99,5 +99,5 @@ Second, format how the above attributes are displayed in prompts:
|
||||||
'prompt' 'git(%b%c)' \
|
'prompt' 'git(%b%c)' \
|
||||||
'rprompt' '[%R]'
|
'rprompt' '[%R]'
|
||||||
|
|
||||||
Last, add `${git_info[prompt]}` to `PS1` and `${git_info[rprompt]}` to `RPS1`
|
Last, add `${(e)git_info[prompt]}` and `${(e)git_info[rprompt]}` to `PS1` and
|
||||||
respectively and call `git-info` in the `prompt_name_precmd` hook function.
|
`RPS1` respectively, and call `git-info` in the `prompt_name_precmd` hook function.
|
||||||
|
|
|
@ -91,8 +91,8 @@ prompt_eriner_main() {
|
||||||
prompt_eriner_git() {
|
prompt_eriner_git() {
|
||||||
if [[ -n ${git_info} ]]; then
|
if [[ -n ${git_info} ]]; then
|
||||||
local indicator
|
local indicator
|
||||||
[[ ${git_info[color]} == yellow ]] && indicator='± '
|
[[ ${git_info[color]} == yellow ]] && indicator=' ±'
|
||||||
prompt_eriner_standout_segment ${git_info[color]} " \${(e)git_info[prompt]} ${indicator}"
|
prompt_eriner_standout_segment ${git_info[color]} " ${(e)git_info[prompt]}${indicator} "
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -123,7 +123,7 @@ prompt_eriner_setup() {
|
||||||
'prompt' '%b%c%s' \
|
'prompt' '%b%c%s' \
|
||||||
'color' '%C%D'
|
'color' '%C%D'
|
||||||
|
|
||||||
PS1="\${(e)\$(prompt_eriner_main ${@:1:2})}"
|
PS1="\$(prompt_eriner_main ${@:1:2})"
|
||||||
RPS1=''
|
RPS1=''
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue