Forum > IDE/CodeTools
"Show as Tab" - IDE directive
xint:
When I implement and test something, I usually work on 2-3 procedures or functions. These are often scattered throughout the source code, so I scroll up and down, always looking for the right procedure.
Sometimes I jump to the procedure by clicking it's event in the object inspector, but that's always a lot of clicking. Unfortunately I've never been able to make friends with the IDE's bookmarks, because that's also a lot of clicking and not very intuitive when bookmarks often change (my personal opinion).
A colleague split his source into individual units so that he can access them flexibly via tabs, what is brilliant to jump between different locations in the source easily but a hassle administratively.
Would it be feasible if there was some kind of IDE directive to display the procedure following the directive as a tab in the IDE ?
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---{%tab}procedure TForm1.FormShow(Sender: TObject);> leads to a IDE-tab named 'TForm1.FormShow'.
or
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---{%tab Show} // manually named tabprocedure TForm1.FormShow(Sender: TObject);> leads to a IDE-tab named 'Show'.
Selecting this 'virtual' tab would show the source as it has been already implemented in with 'open in a new window', but as a separate tab, named accordingly and the cursor (view) already located.
In this way, many places in the source code could be accessed quickly and flexibly.
cdbc:
Hi
It's not what you're looking for, but you can use include-files, to partition your code... They'll show up on their own tab.
Just a thought...
Regards Benny
xint:
Hi Benny,
Thanks for your suggestion. I know that I can split my source into several include files. But not every single fragment of the code worth it to be separated.
I was just suggesting a way to access different sections of code with just a single extra line of text. An ln-line bookmark that shows up as a tab - easy to watch, easy to access and (!) most easy to organize and reorganize.
Rgds, Stefan
Martin_fr:
There are several ways you can currently use.
1) Multiple source windows.
Right click the tab of the existing editor for that code, and chose "Clone to other Window". Repeat this as often as you need.
- Scroll each tab to one of your functions.
- Right click the tab of each of those editors and chose "Lock" to prevent the IDE from scrolling it for code navigation. The IDE will then use an editor for that unit which is not locked => so one should be left unlocked.
2) Navigate with the code explorer and/or bookmarks
3) Fold the code between the functions
Select the code between the functions, and it will allow you to fold the selected code away.
Or fold using {%region} {%endregion}
4) Use TODO comments and the TODO window as navigation
Martin_fr:
I don't think that the {%tab} idea will be done... (except if some one does it as 3rd party add on....)
What I could imagine (but don't have time for) is the sort of drop down that lists all procedures, and if you select one, the editor will show this and only this procedure....
Then that could be combined with several editor windows.
Navigation
[0] Message Index
[#] Next page