BTS

Message3732

Author btittelbach
Recipients btittelbach, ft
Date 2011-04-19.20:48:49
Content
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))
}
History
Date User Action Args
2011-04-19 20:48:51btittelbachsetrecipients: + btittelbach, ft
2011-04-19 20:48:51btittelbachsetmessageid: <1303246131.01.0.280922394054.issue980@bts.grml.org>
2011-04-19 20:48:50btittelbachlinkissue980 messages
2011-04-19 20:48:49btittelbachcreate