summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2019-08-20 15:22:27 +0300
committerromkatv <roman.perepelitsa@gmail.com>2019-08-20 15:22:27 +0300
commita5e9af847d7052d920a340e12b823e600ae10a9e (patch)
tree7904ea02b0c5499eac26ffa5b736543ba52d3a80
parent727d42ff489f9be998df97e90f4356b2faaffbc5 (diff)
simplify nordvpn
-rwxr-xr-xinternal/p10k.zsh17
1 files changed, 2 insertions, 15 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh
index 467985d7..30499b66 100755
--- a/internal/p10k.zsh
+++ b/internal/p10k.zsh
@@ -2954,12 +2954,11 @@ function _p9k_fetch_nordvpn_status() {
IFS='' read -t 0.25 -r tag <&3
tag=$'\015'
while true; do
- tag=${__p9k_char2byte[${(q+)tag}]:-0}
+ tag=$((#tag))
(( (tag >>= 3) && tag <= $#__p9k_nordvpn_tag )) || break
tag=$__p9k_nordvpn_tag[tag]
sysread -c n -s 1 -t 0.25 len <&3
- len=${__p9k_char2byte[${(q+)len}]}
- [[ -n $len ]]
+ len=$((#len))
val=
(( ! len )) || {
sysread -c n -s $len -t 0.25 val <&3
@@ -4281,18 +4280,6 @@ _p9k_init() {
print -rP -- 'Either install %F{green}jq%f or change the value of %BPOWERLEVEL9K_SHORTEN_STRATEGY%b.'
fi
- # There is no q+ flag before 5.3.
- if (( !$+__p9k_char2byte )) && _p9k_segment_in_use nordvpn && is-at-least 5.3; then
- typeset -gA __p9k_char2byte=()
- local -i x=0 y=0
- for x in {0..7}; do
- for y in {0..7}; do
- __p9k_char2byte[${(q+)${(g:o:):-\\$x$y}}]=$((8*x+y))
- done
- done
- typeset -grA __p9k_char2byte
- fi
-
if _p9k_segment_in_use status; then
typeset -g _p9k_exitcode2str=({0..255})
local -i i=2