after using sudo-command-line, the CL-length will have increased by 5 chars. As
the cursor position stays the same, this amounts to a cursor offset with respect
to my typed test of 5 chars to the left.
please increase CURSOR position by 5 chars (==strlen "sudo "), so cursorposition
remains the same, relative to typed test
proposal:
sudo-command-line() {
[[ -z $BUFFER ]] && zle up-history
[[ $BUFFER != sudo\ * ]] && BUFFER="sudo $BUFFER" && CURSOR=$((CURSOR+5))
} |