README: use spaces for indentation
This commit is contained in:
parent
4fa98abec3
commit
e38f0234c9
32
README.adoc
32
README.adoc
|
@ -42,12 +42,12 @@ zsh
|
||||||
To start using this navigator, put the following in your .zshrc:
|
To start using this navigator, put the following in your .zshrc:
|
||||||
....
|
....
|
||||||
sdn-navigate () {
|
sdn-navigate () {
|
||||||
# ... possibly zle-line-init
|
# ... possibly zle-line-init
|
||||||
eval `sdn`
|
eval `sdn`
|
||||||
[ -z "$cd" ] || cd "$cd"
|
[ -z "$cd" ] || cd "$cd"
|
||||||
[ -z "$insert" ] || LBUFFER="$LBUFFER$insert "
|
[ -z "$insert" ] || LBUFFER="$LBUFFER$insert "
|
||||||
zle reset-prompt
|
zle reset-prompt
|
||||||
# ... possibly zle-line-finish
|
# ... possibly zle-line-finish
|
||||||
}
|
}
|
||||||
zle -N sdn-navigate
|
zle -N sdn-navigate
|
||||||
bindkey '\eo' sdn-navigate
|
bindkey '\eo' sdn-navigate
|
||||||
|
@ -59,19 +59,19 @@ Here we can't reset the prompt from within a `bind -x` handler but there is
|
||||||
an acceptable workaround:
|
an acceptable workaround:
|
||||||
....
|
....
|
||||||
sdn-navigate () {
|
sdn-navigate () {
|
||||||
SDN_L=$READLINE_LINE SDN_P=$READLINE_POINT
|
SDN_L=$READLINE_LINE SDN_P=$READLINE_POINT
|
||||||
READLINE_LINE=
|
READLINE_LINE=
|
||||||
|
|
||||||
eval `sdn`
|
eval `sdn`
|
||||||
[[ -z "$cd" ]] || cd "$cd"
|
[[ -z "$cd" ]] || cd "$cd"
|
||||||
[[ -z "$insert" ]] || {
|
[[ -z "$insert" ]] || {
|
||||||
SDN_L="${SDN_L:0:$SDN_P}$insert ${SDN_L:$SDN_P}"
|
SDN_L="${SDN_L:0:$SDN_P}$insert ${SDN_L:$SDN_P}"
|
||||||
((SDN_P=SDN_P+${#insert}+1))
|
((SDN_P=SDN_P+${#insert}+1))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sdn-restore () {
|
sdn-restore () {
|
||||||
READLINE_LINE=$SDN_L READLINE_POINT=$SDN_P
|
READLINE_LINE=$SDN_L READLINE_POINT=$SDN_P
|
||||||
unset SDN_L SDN_P
|
unset SDN_L SDN_P
|
||||||
}
|
}
|
||||||
|
|
||||||
bind -x '"\200": sdn-navigate'
|
bind -x '"\200": sdn-navigate'
|
||||||
|
|
Loading…
Reference in New Issue