mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-25 08:56:43 +08:00
Always source
file after funced
(#10318)
... even if the file hasn't changed. This addresses an oddity in the following case: * Shell is started, * function `foo` is sourced from foo.fish * foo.fish is *externally* edited and saved * <Loaded definition of `foo` is now stale, but fish is unaware> * `funced foo` loads `type -p foo` showing changed definition, user exits $EDITOR saving no changes (or with $status 0, more generally). * Stale definition of `foo` remains
This commit is contained in:
parent
e207f8464e
commit
2c2ab0c1fa
|
@ -115,7 +115,9 @@ function funced --description 'Edit function definition'
|
|||
if test "$new_checksum" = "$checksum"
|
||||
echo (_ "Editor exited but the function was not modified")
|
||||
echo (_ "If the editor is still running, check if it waits for completion, maybe a '--wait' option?")
|
||||
# Don't source or save an unmodified file.
|
||||
# Source but don't save an unmodified file.
|
||||
# (Source in case the file changed externally since we first loaded it.)
|
||||
source "$writepath"
|
||||
break
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user