From 136cc1e1b79ebc07f5deb630fea9d325276d077c Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Fri, 15 Mar 2013 20:15:10 +0000 Subject: 31154: make zcalc understand continuation lines with a backslash --- Functions/Misc/zcalc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'Functions') diff --git a/Functions/Misc/zcalc b/Functions/Misc/zcalc index 3d44f20db..d78c35ed2 100644 --- a/Functions/Misc/zcalc +++ b/Functions/Misc/zcalc @@ -155,7 +155,17 @@ for (( num = 1; num <= $#; num++ )); do done psvar[1]=$num -while vared -cehp "${ZCALCPROMPT}" line; do +local prev_line cont_prompt +while vared -cehp "${cont_prompt}${ZCALCPROMPT}" line; do + if [[ $line = (|*[^\\])('\\')#'\' ]]; then + prev_line+=$line[1,-2] + cont_prompt="..." + line= + continue + fi + line="$prev_line$line" + prev_line= + cont_prompt= [[ -z $line ]] && break # special cases # Set default base if `[#16]' or `[##16]' etc. on its own. -- cgit 1.4.1