1 (edited by JohnWasilewski 2014-02-04 09:38:01)

Topic: Keeping track of current subprogram whilst editing

Before reading this post, I suggest reading my earlier posted topic,

     "Best strategy for source file structure?"

Under that topic heading, I mentioned three strategies, viz:
(1)  Only one source file for a project.
(2)  Multiple source files for a project.
(3)  Separate source files for main program and every subroutine.

I now write to ask Jeff if he can think of an additional way of helping us keep track of where we are in a project during debugging, for people using any source file strategy other than (3).

During debugging and editing with (3), it's easy to see where we are in a project because the current subroutine name is the same as the source file name, and this appears on the current tab.

B U T . . .

Using strategy (2) or (perish the thought) strategy (1), during editing or debugging, I can see from the name on the tab which source file is the current one but, except near the start of a subroutine when its name hasn't scrolled off the screen, I can find nothing displayed on the screen to tell me which subroutine I'm in.

During debugging in particular, where the program line pointer leaps about under program control not my editing control, from one subroutine to another (with or without breakpoints), I am continually losing track of which subroutine I'm in.  I have to keep scrolling up to find the subroutine title then scrolling back down to see the program line pointer before resuming pressing F8 or F9.  This is most exceedingly inefficient!

I'm unsure whether SF knows all the time which subroutine the editor cursor is in and which subroutine the debugging line pointer is in.   If SF does know this then I for on would find it immensely helpful to have this information shown on the creen somewhere.  In the status bar at the bottom, for example.
---
John

Re: Keeping track of current subprogram whilst editing

John,

There are two places where your current location are shown.  When purely editing, the File Outline will actually subtly highlight which subprogram you are currently in (if Simply Fortran successfully determines this position).

When debugging, if you switch to the "Stack" view in the debugger panel, it will list the current subprogram position where the debugger has most recently hit a breakpoint.  The furthest call down the stack (where the current debugging position is) will be the last line in the Stack view, and the call history to get to that location proceeds upward from this last entry.  You can double click on any name in the Stack view to instantly navigate to that location.

Note also that, when debugging, the File Outline position indicator will continue to work as well if you switch to the File Outline panel.

Neither of these views are available all the time, so there may be a benefit of showing the code position elsewhere, perhaps in the status line next to the line/column indicators.

Jeff Armstrong
Approximatrix, LLC

Re: Keeping track of current subprogram whilst editing

Jeff, I forgot to say how very useful I find this feature :

When purely editing, the File Outline will actually subtly highlight which subprogram you are currently in.

It would also be helpful if the same information could appear somewhere on either the editing pane or in the project outline whilst editing, and I've given some thought on whether there is anything I can suggest. I've created a screenshot of what I have come up with.  I tried to find a way of posting the image here but I've given up, so I'll email it.

My suggestion is that, whenever a user selects a source file for editing from the Project Outline or selects an already-open source file tab, the project outline should be repainted to drop in, immediately below the filename for that file alone, its file outline.  The currently-edited subprogram can then always be highlighted in the project outline, as well as in the file outline, which would be really good.  The email I'll send in shows how this could look.

I make this suggestion because I would find it a very useful enhancement, and because I think SF must already have all the information needed when a user selects a source file for editing.  I hope you think it's a good idea, Jeff.  its not a  high priority request, now that you've reminded me that I can keep track of where I am just by switching to the File Outline, but a nice enhancement nonetheless, if you can put it on your list.
---
John