diff options
author | Barton E. Schaefer <schaefer@zsh.org> | 2014-04-07 07:21:21 -0700 |
---|---|---|
committer | Barton E. Schaefer <schaefer@zsh.org> | 2014-04-07 07:21:21 -0700 |
commit | 141089231c9731811939d6ce24888fc95693eb6e (patch) | |
tree | 376d6a022648790ae06fec23c1c2877e6fa9b1b7 /Functions/Zle/zcalc-auto-insert | |
parent | 2be3ff58e234456348765e435ef3185ff9d43a1c (diff) | |
parent | 08d4a6136e5c289d1be6d6290568866c2d59ef53 (diff) | |
download | zsh-141089231c9731811939d6ce24888fc95693eb6e.tar.gz zsh-141089231c9731811939d6ce24888fc95693eb6e.tar.xz zsh-141089231c9731811939d6ce24888fc95693eb6e.zip |
Merge branch 'master' of git://git.code.sf.net/p/zsh/code
Conflicts: ChangeLog
Diffstat (limited to 'Functions/Zle/zcalc-auto-insert')
-rw-r--r-- | Functions/Zle/zcalc-auto-insert | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Functions/Zle/zcalc-auto-insert b/Functions/Zle/zcalc-auto-insert new file mode 100644 index 000000000..c9a5c8867 --- /dev/null +++ b/Functions/Zle/zcalc-auto-insert @@ -0,0 +1,8 @@ +# Bind to a binary operator keystroke for use with zcalc + +if [[ -n $ZCALC_ACTIVE ]]; then + if [[ $CURSOR -eq 0 || $LBUFFER[-1] = "(" ]]; then + LBUFFER+=${ZCALC_AUTO_INSERT_PREFIX:-"ans "} + fi +fi +zle .self-insert |