diff options
author | Roman Perepelitsa <roman.perepelitsa@gmail.com> | 2020-11-25 18:36:03 +0300 |
---|---|---|
committer | Roman Perepelitsa <roman.perepelitsa@gmail.com> | 2020-11-25 18:36:03 +0300 |
commit | 98a8ec6f31c1ba0be1b66cb592df76934c4eb3a4 (patch) | |
tree | da998ce4efdbce97def648bb7d98b1f9a63237fb /internal/wizard.zsh | |
parent | 685682da908a3f29ad6b4ed41e3cef31720a59a2 (diff) |
prompt_length cleanup
Diffstat (limited to 'internal/wizard.zsh')
-rw-r--r-- | internal/wizard.zsh | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/internal/wizard.zsh b/internal/wizard.zsh index 7562c2bc..39edc089 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -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() { |