mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2026-09-18 00:10:08 +00:00
prompt_length cleanup
This commit is contained in:
+5
-6
@@ -110,20 +110,19 @@ local -ra rainbow_right=(
|
||||
)
|
||||
|
||||
function prompt_length() {
|
||||
local COLUMNS=1024
|
||||
local -i COLUMNS=1024
|
||||
local -i x y=$#1 m
|
||||
if (( y )); then
|
||||
while (( ${${(%):-$1%$y(l.1.0)}[-1]} )); do
|
||||
x=y
|
||||
(( y *= 2 ));
|
||||
(( y *= 2 ))
|
||||
done
|
||||
local xy
|
||||
while (( y > x + 1 )); do
|
||||
m=$(( x + (y - x) / 2 ))
|
||||
typeset ${${(%):-$1%$m(l.x.y)}[-1]}=$m
|
||||
(( m = x + (y - x) / 2 ))
|
||||
(( ${${(%):-$1%$m(l.x.y)}[-1]} = m ))
|
||||
done
|
||||
fi
|
||||
REPLY=$x
|
||||
typeset -g REPLY=$x
|
||||
}
|
||||
|
||||
function print_prompt() {
|
||||
|
||||
Reference in New Issue
Block a user