funcsave: avoid the edited function's path being a temporary file

As functions know where they are loaded from now, there is no point in
them being marked as loaded from a temporary file that has been removed.
Source the function via a redirect instead.
This commit is contained in:
David Adam 2021-07-10 21:30:31 +08:00
parent a40e60b45b
commit 911269c4a9

View File

@ -107,7 +107,7 @@ function funced --description 'Edit function definition'
end
end
if not source $tmpname
if not source <$tmpname
# Failed to source the function file. Prompt to try again.
echo # add a line between the parse error and the prompt
set -l repeat