diff options
author | Přemysl Janouch <p.janouch@gmail.com> | 2017-06-30 22:55:18 +0200 |
---|---|---|
committer | Přemysl Janouch <p.janouch@gmail.com> | 2017-06-30 22:55:18 +0200 |
commit | e38f0234c9d9ae889fa786539136b973ba80d98e (patch) | |
tree | db8421b4533ed7641fc7b7a5d16ce624fb181633 /README.adoc | |
parent | 4fa98abec391fd03e11ec404d819b2bd5584e854 (diff) | |
download | sdn-e38f0234c9d9ae889fa786539136b973ba80d98e.tar.gz sdn-e38f0234c9d9ae889fa786539136b973ba80d98e.tar.xz sdn-e38f0234c9d9ae889fa786539136b973ba80d98e.zip |
README: use spaces for indentation
Diffstat (limited to 'README.adoc')
-rw-r--r-- | README.adoc | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/README.adoc b/README.adoc index 1b9cdd2..3dcc706 100644 --- a/README.adoc +++ b/README.adoc @@ -42,12 +42,12 @@ zsh To start using this navigator, put the following in your .zshrc: .... sdn-navigate () { - # ... possibly zle-line-init - eval `sdn` - [ -z "$cd" ] || cd "$cd" - [ -z "$insert" ] || LBUFFER="$LBUFFER$insert " - zle reset-prompt - # ... possibly zle-line-finish + # ... possibly zle-line-init + eval `sdn` + [ -z "$cd" ] || cd "$cd" + [ -z "$insert" ] || LBUFFER="$LBUFFER$insert " + zle reset-prompt + # ... possibly zle-line-finish } zle -N 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: .... sdn-navigate () { - SDN_L=$READLINE_LINE SDN_P=$READLINE_POINT - READLINE_LINE= - - eval `sdn` - [[ -z "$cd" ]] || cd "$cd" - [[ -z "$insert" ]] || { - SDN_L="${SDN_L:0:$SDN_P}$insert ${SDN_L:$SDN_P}" - ((SDN_P=SDN_P+${#insert}+1)) - } + SDN_L=$READLINE_LINE SDN_P=$READLINE_POINT + READLINE_LINE= + + eval `sdn` + [[ -z "$cd" ]] || cd "$cd" + [[ -z "$insert" ]] || { + SDN_L="${SDN_L:0:$SDN_P}$insert ${SDN_L:$SDN_P}" + ((SDN_P=SDN_P+${#insert}+1)) + } } sdn-restore () { - READLINE_LINE=$SDN_L READLINE_POINT=$SDN_P - unset SDN_L SDN_P + READLINE_LINE=$SDN_L READLINE_POINT=$SDN_P + unset SDN_L SDN_P } bind -x '"\200": sdn-navigate' |