first commit
This commit is contained in:
commit
0610f4aeab
130 changed files with 9897 additions and 0 deletions
15
fn/-z4h-prompt-length
Normal file
15
fn/-z4h-prompt-length
Normal file
|
@ -0,0 +1,15 @@
|
|||
#!/usr/bin/env zsh
|
||||
|
||||
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 ))
|
||||
done
|
||||
while (( y > x + 1 )); do
|
||||
(( m = x + (y - x) / 2 ))
|
||||
(( ${${(%):-$1%$m(l.x.y)}[-1]} = m ))
|
||||
done
|
||||
fi
|
||||
typeset -g REPLY=$x
|
Loading…
Add table
Add a link
Reference in a new issue