Server IP : 51.89.169.208 / Your IP : 216.73.216.211 Web Server : Apache System : Linux ns3209505.ip-198-244-202.eu 4.18.0-553.27.1.el8_10.x86_64 #1 SMP Tue Nov 5 04:50:16 EST 2024 x86_64 User : yellowleaf ( 1019) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/thread-self/root/proc/self/root/usr/share/zsh/5.5.1/functions/ |
Upload File : |
emulate -L zsh setopt extendedglob local opt keys integer stat while getopts "k:" opt; do case $opt in # Read the given number of keys. This is a bit # ropey for more than a single key. (k) keys=$OPTARG ;; (*) return 1 ;; esac done (( OPTIND > 1 )) && shift $(( OPTIND - 1 )) local readprompt="$1" lbuf_init="$2" rbuf_init="$3" integer savelim=$UNDO_LIMIT_NO changeno=$UNDO_CHANGE_NO { # Use anonymous function to make sure special values get restored, # even if this function is called as a widget. # local +h ensures special parameters stay special. () { local pretext="$PREDISPLAY$LBUFFER$RBUFFER$POSTDISPLAY " local +h LBUFFER="$lbuf_init" local +h RBUFFER="$rbuf_init" local +h PREDISPLAY="$pretext${readprompt:-? }" local +h POSTDISPLAY= local +h -a region_highlight region_highlight=("P${#pretext} ${#PREDISPLAY} bold") if [[ -n $keys ]]; then zle -R read -k $keys stat=$? else local NUMERIC unset NUMERIC zle split-undo UNDO_LIMIT_NO=$UNDO_CHANGE_NO zle recursive-edit -K main stat=$? (( stat )) || REPLY=$BUFFER fi } } always { # This removes the edits relating to the read from the undo history. # These aren't useful once we get back to the main editing buffer. zle undo $changeno UNDO_LIMIT_NO=savelim } return $stat