diff options
author | romkatv <roman.perepelitsa@gmail.com> | 2019-09-17 10:59:39 +0300 |
---|---|---|
committer | romkatv <roman.perepelitsa@gmail.com> | 2019-09-17 10:59:39 +0300 |
commit | f79ad6524376dcf9e7d4d9b396c5746c1ff24c28 (patch) | |
tree | 8e6ca54e4bad056b63339f5897250eb5aa3019ac /internal/p10k.zsh | |
parent | 2218060b2d8b4ca7edf1299c65871cdf700898e3 (diff) |
more robust KEYMAP handling
Diffstat (limited to 'internal/p10k.zsh')
-rwxr-xr-x | internal/p10k.zsh | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 8c3b2cee..90460f49 100755 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -2031,13 +2031,13 @@ prompt_status() { prompt_prompt_char() { if (( _p9k_status )); then - _p9k_prompt_segment $0_ERROR_VIINS "$_p9k_color1" 196 '' 0 '${${${KEYMAP:-$_p9k_keymap}:-0}:#(vicmd|vivis|vivli)}' '❯' - _p9k_prompt_segment $0_ERROR_VICMD "$_p9k_color1" 196 '' 0 '${(M)${:-${KEYMAP:-$_p9k_keymap}$_p9k_region_active}:#vicmd0}' '❮' - _p9k_prompt_segment $0_ERROR_VIVIS "$_p9k_color1" 196 '' 0 '${(M)${:-${KEYMAP:-$_p9k_keymap}$_p9k_region_active}:#(vicmd1|vivis?|vivli?)}' 'Ⅴ' + _p9k_prompt_segment $0_ERROR_VIINS "$_p9k_color1" 196 '' 0 '${_p9k_keymap:#(vicmd|vivis|vivli)}' '❯' + _p9k_prompt_segment $0_ERROR_VICMD "$_p9k_color1" 196 '' 0 '${(M)${:-$_p9k_keymap$_p9k_region_active}:#vicmd0}' '❮' + _p9k_prompt_segment $0_ERROR_VIVIS "$_p9k_color1" 196 '' 0 '${(M)${:-$_p9k_keymap$_p9k_region_active}:#(vicmd1|vivis?|vivli?)}' 'Ⅴ' else - _p9k_prompt_segment $0_OK_VIINS "$_p9k_color1" 76 '' 0 '${${${KEYMAP:-$_p9k_keymap}:-0}:#(vicmd|vivis|vivli)}' '❯' - _p9k_prompt_segment $0_OK_VICMD "$_p9k_color1" 76 '' 0 '${(M)${:-${KEYMAP:-$_p9k_keymap}$_p9k_region_active}:#vicmd0}' '❮' - _p9k_prompt_segment $0_OK_VIVIS "$_p9k_color1" 76 '' 0 '${(M)${:-${KEYMAP:-$_p9k_keymap}$_p9k_region_active}:#(vicmd1|vivis?|vivli?)}' 'Ⅴ' + _p9k_prompt_segment $0_OK_VIINS "$_p9k_color1" 76 '' 0 '${_p9k_keymap:#(vicmd|vivis|vivli)}' '❯' + _p9k_prompt_segment $0_OK_VICMD "$_p9k_color1" 76 '' 0 '${(M)${:-$_p9k_keymap$_p9k_region_active}:#vicmd0}' '❮' + _p9k_prompt_segment $0_OK_VIVIS "$_p9k_color1" 76 '' 0 '${(M)${:-$_p9k_keymap$_p9k_region_active}:#(vicmd1|vivis?|vivli?)}' 'Ⅴ' fi } @@ -2711,13 +2711,13 @@ prompt_vcs() { # Vi Mode: show editing mode (NORMAL|INSERT|VISUAL) prompt_vi_mode() { if [[ -n $_POWERLEVEL9K_VI_INSERT_MODE_STRING ]]; then - _p9k_prompt_segment $0_INSERT "$_p9k_color1" blue '' 0 '${${${KEYMAP:-$_p9k_keymap}:-0}:#(vicmd|vivis|vivli)}' "$_POWERLEVEL9K_VI_INSERT_MODE_STRING" + _p9k_prompt_segment $0_INSERT "$_p9k_color1" blue '' 0 '${_p9k_keymap:#(vicmd|vivis|vivli)}' "$_POWERLEVEL9K_VI_INSERT_MODE_STRING" fi if (( $+_POWERLEVEL9K_VI_VISUAL_MODE_STRING )); then - _p9k_prompt_segment $0_NORMAL "$_p9k_color1" white '' 0 '${(M)${:-${KEYMAP:-$_p9k_keymap}$_p9k_region_active}:#vicmd0}' "$_POWERLEVEL9K_VI_COMMAND_MODE_STRING" - _p9k_prompt_segment $0_VISUAL "$_p9k_color1" white '' 0 '${(M)${:-${KEYMAP:-$_p9k_keymap}$_p9k_region_active}:#(vicmd1|vivis?|vivli?)}' "$_POWERLEVEL9K_VI_VISUAL_MODE_STRING" + _p9k_prompt_segment $0_NORMAL "$_p9k_color1" white '' 0 '${(M)${:-$_p9k_keymap$_p9k_region_active}:#vicmd0}' "$_POWERLEVEL9K_VI_COMMAND_MODE_STRING" + _p9k_prompt_segment $0_VISUAL "$_p9k_color1" white '' 0 '${(M)${:-$_p9k_keymap$_p9k_region_active}:#(vicmd1|vivis?|vivli?)}' "$_POWERLEVEL9K_VI_VISUAL_MODE_STRING" else - _p9k_prompt_segment $0_NORMAL "$_p9k_color1" white '' 0 '${(M)${KEYMAP:-$_p9k_keymap}:#(vicmd|vivis|vivli)}' "$_POWERLEVEL9K_VI_COMMAND_MODE_STRING" + _p9k_prompt_segment $0_NORMAL "$_p9k_color1" white '' 0 '${(M)_p9k_keymap:#(vicmd|vivis|vivli)}' "$_POWERLEVEL9K_VI_COMMAND_MODE_STRING" fi } @@ -4047,6 +4047,7 @@ _p9k_init_prompt() { _p9k_prompt_suffix_left='${${COLUMNS::=$_p9k_clm}+}' _p9k_prompt_suffix_right='${${COLUMNS::=$_p9k_clm}+}' + _p9k_prompt_prefix_left+='${${_p9k_keymap::=${KEYMAP:-$_p9k_keymap}}+}' _p9k_prompt_prefix_left+='%b%k%f' # Bug fixed in: https://github.com/zsh-users/zsh/commit/3eea35d0853bddae13fa6f122669935a01618bf9. |