1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-11-11 00:10:08 +00:00

Merge pull request #3141 from muggenhor/sudo-maintain-cursor-pos

sudo: maintain cursor position
This commit is contained in:
Robby Russell 2015-02-10 11:18:32 -08:00
commit 412a92e45e

View file

@ -13,9 +13,8 @@
# ------------------------------------------------------------------------------
sudo-command-line() {
[[ -z $BUFFER ]] && zle up-history
[[ $BUFFER != sudo\ * ]] && BUFFER="sudo $BUFFER"
zle end-of-line
[[ -z $BUFFER ]] && zle up-history
[[ $BUFFER != sudo\ * ]] && LBUFFER="sudo $LBUFFER"
}
zle -N sudo-command-line
# Defined shortcut keys: [Esc] [Esc]