You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
funced the whole .fish file contents, not only function body #391
Sometime the .fish file contains not only the function definition, but some variable definitions. Sometimes the function definition depends on a system, so there is if/function/else/function construction.
When funced is invoked it let you edit only the function name, options and body. After applying funcsave all the other information is lost.
It would be very helpful if function could contain the whole contents of the .fish file instead. So when you type funced, you can also modify the preceeding variables, conditions and comments.
This is a good idea, but is nontrivial to implement because the functions builtin would have to determine whether the function came from a file, and funced would have to be taught how to use it.
As discussed in issue #3701 we should do two things:
Make it possible to edit the file in which the function was originally defined using the funced command.
Warn the user about losing their edits if they don't invoke funced with the --save or --perm flag (the flag name is still open for discussion).
To be determined is whether we can, or should, attempt to protect the user from doing funcsave $func_name when the file in which the function was defined contains other statements and comments.
Activity
ridiculousfish commentedon Dec 2, 2012
This is a good idea, but is nontrivial to implement because the
functionsbuiltin would have to determine whether the function came from a file, andfuncedwould have to be taught how to use it.krader1961 commentedon Dec 12, 2016
This should be easy to do after issue #3295 is implemented.
krader1961 commentedon Jan 10, 2017
As discussed in issue #3701 we should do two things:
Make it possible to edit the file in which the function was originally defined using the
funcedcommand.Warn the user about losing their edits if they don't invoke
funcedwith the--saveor--permflag (the flag name is still open for discussion).To be determined is whether we can, or should, attempt to protect the user from doing
funcsave $func_namewhen the file in which the function was defined contains other statements and comments.funcsave: edit the whole file containing a function
funcsave: edit the whole file containing a function
funcsave: edit the whole file containing a function
funcsave: edit the whole file containing a function
funcsave: edit the whole file containing a function