mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-28 05:00:59 +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
1 changed files with 3 additions and 10 deletions
|
|
@ -86,20 +86,13 @@
|
|||
emulate -L zsh
|
||||
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 compcontext="-math-"
|
||||
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' )
|
||||
|
||||
zmodload -i zsh/mathfunc 2>/dev/null
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue