mirror of
git://git.code.sf.net/p/zsh/code
synced 2024-11-19 13:33:52 +01:00
Use the new `history -ap' command to restore the history instead of
using a trap function.
This commit is contained in:
parent
f0742aeaa5
commit
6cfedab7ee
@ -86,20 +86,13 @@
|
|||||||
emulate -L zsh
|
emulate -L zsh
|
||||||
setopt extendedglob
|
setopt extendedglob
|
||||||
|
|
||||||
# push to our own history file
|
|
||||||
fc -p ~/.zcalc_history
|
|
||||||
|
|
||||||
zcalc_restore() {
|
|
||||||
unfunction zcalc_restore
|
|
||||||
# pop back to original history
|
|
||||||
fc -P
|
|
||||||
}
|
|
||||||
trap zcalc_restore HUP INT QUIT EXIT
|
|
||||||
|
|
||||||
local line ans base defbase forms match mbegin mend psvar optlist opt arg
|
local line ans base defbase forms match mbegin mend psvar optlist opt arg
|
||||||
local compcontext="-math-"
|
local compcontext="-math-"
|
||||||
integer num outdigits outform=1
|
integer num outdigits outform=1
|
||||||
|
|
||||||
|
# We use our own history file with an automatic pop on exit.
|
||||||
|
history -ap ~/.zcalc_history
|
||||||
|
|
||||||
forms=( '%2$g' '%.*g' '%.*f' '%.*E' )
|
forms=( '%2$g' '%.*g' '%.*f' '%.*E' )
|
||||||
|
|
||||||
zmodload -i zsh/mathfunc 2>/dev/null
|
zmodload -i zsh/mathfunc 2>/dev/null
|
||||||
|
Loading…
Reference in New Issue
Block a user