summary refs log tree commit diff
path: root/Functions/Misc/zcalc
diff options
context:
space:
mode:
Diffstat (limited to 'Functions/Misc/zcalc')
-rw-r--r--Functions/Misc/zcalc12
1 files changed, 11 insertions, 1 deletions
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.