mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-23 16:40:24 +02:00
31154: make zcalc understand continuation lines with a backslash
This commit is contained in:
parent
a69f05b4ce
commit
136cc1e1b7
3 changed files with 23 additions and 3 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue