In the Editor window of Octave GUI, if I right click on a function (say, f1
) in an expression where it is called, and "Edit f1", function file f1.m
opens.
But if my function (now plot_color_marker_ranges
) is defined in a script file instead of a function file, when I right-click in an expression where it is called (1) and "Edit" (2) I get the following message
Can I get hyperlinking and navigation when a function is defined in a script file instead of a function file?
Steps to reproduce
- Create script file
myscript.m
containing a functionf1
. This script file has as its first command1;
. - Create script file
mymain.m
, and add an expression that callsf1
. Add alsosource('myscript.m')
above the first call tof1
. This script is in the same directory asmyscript.m
. At this point, both files were saved on disk. - Run
mymain.m
from the Editor window of Octave GUI to make suref1
is correctly used frommymain
. - Navigate in the Editor window of Octave GUI to the expression that uses
f1
. - Right click on any part of the text "
f1
". - Click on "Edit f1".
EDIT:
Notes:
- This helps a lot with editing and debugging.
- As of now, whenever I need to debug I set an M-file for the functions. Then I may transfer the function to a script file.
- Using Octave 5.1.0 configured for mingw32 under Win 10.