aboutsummaryrefslogtreecommitdiff
path: root/functions
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2019-05-27 20:11:09 +0300
committerromkatv <roman.perepelitsa@gmail.com>2019-05-27 20:11:09 +0300
commita405d8af70343f3fc652af5e62731c3c0e2b5f81 (patch)
tree09b6cea0e922ce3a1ddf3e5b8917342391aaa633 /functions
parentd1e5fd27eedb8153ebe0f49fdc1788b10c695618 (diff)
optimize _p9k_g_expand a little
Diffstat (limited to 'functions')
-rwxr-xr-xfunctions/utilities.zsh5
1 files changed, 4 insertions, 1 deletions
diff --git a/functions/utilities.zsh b/functions/utilities.zsh
index f5f4f7dd..d99da411 100755
--- a/functions/utilities.zsh
+++ b/functions/utilities.zsh
@@ -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 ))