optimize _p9k_g_expand a little

pull/78/head
romkatv 2019-05-27 19:11:09 +02:00
parent d1e5fd27ee
commit a405d8af70
1 changed files with 4 additions and 1 deletions

View File

@ -58,7 +58,10 @@ function _p9k_prompt_length() {
emulate -L zsh
local -i x y=$#1 m
if (( y )); then
while (( ${${(%):-$1%$y(l.1.0)}[-1]} )); do (( y *= 2 )); done
while (( ${${(%):-$1%$y(l.1.0)}[-1]} )); do
x=y
(( y *= 2 ));
done
local xy
while (( y > x + 1 )); do
m=$(( x + (y - x) / 2 ))