TH3-Code Collapse » History » Version 3
Wil van Antwerpen, 06/01/2019 10:53 PM
| 1 | 1 | Wil van Antwerpen | # Code Collapse |
|---|---|---|---|
| 2 | |||
| 3 | The Hammer 3.0 is based on the scintilla control and as such it wasn't too hard to add code collapse specifically for the DataFlex language. |
||
| 4 | This is one of those features that you don't miss until you actually have it. |
||
| 5 | 3 | Wil van Antwerpen | ##How does it work? |
| 6 | 1 | Wil van Antwerpen | |
| 7 | 2 | Wil van Antwerpen | You get to see a (-) symbol in front of the line of code that can be collapsed. |
| 8 | If you click that (-) symbol it will collapse a block of code into one line and the symbol will change into a (+) symbol. |
||
| 9 | 1 | Wil van Antwerpen | |
| 10 | 2 | Wil van Antwerpen | Currently the following scope keywords automatically support the code collapse feature: |
| 11 | |||
| 12 | 1 | Wil van Antwerpen | * begin / end code blocks |
| 13 | * object / end_object |
||
| 14 | * class / end_class |
||
| 15 | * procedure / end_procedure |
||
| 16 | * function / end_function |
||
| 17 | * while / loop |
||
| 18 | * case begin / case end |
||
| 19 | * type / end_type |
||
| 20 | * struct / end_struct |
||
| 21 | 2 | Wil van Antwerpen | * #COMMAND / #ENDCOMMAND |
| 22 | * comments (1) |
||
| 23 | 1 | Wil van Antwerpen | * section metatags (see below) |
| 24 | 2 | Wil van Antwerpen | |
| 25 | ## comments |
||
| 26 | |||
| 27 | If you have multiple lines of comments then you can collapse those lines to one line by clicking on the (+) symbol in front of the line. |
||
| 28 | 1 | Wil van Antwerpen | |
| 29 | ## section metatags |
||
| 30 | |||
| 31 | If you want to be able to collapse a whole bunch of code so that you can quickly hide specific parts of code then use the section metatag collapse feature. |
||
| 32 | |||
| 33 | It works as follows: |
||
| 34 | |||
| 35 | ~~~ |
||
| 36 | { #CodeSection YourSection } |
||
| 37 | .... your code |
||
| 38 | { #CodeSection YourSection } |
||
| 39 | ~~~ |
||
| 40 | |||
| 41 | This then looks as follows: |
||
| 42 | |||
| 43 | <insert screenshot here> |
||
| 44 | |||
| 45 | ## compiler listfiles |
||
| 46 | |||
| 47 | This one is pretty useful and not one you would think of immediately. |
||
| 48 | |||
| 49 | If you have a .prn/.prp file then you actually have code collapse in there as well (was broken, just fixed 2019-05-17) |
||
| 50 | |||
| 51 | It can really be a drag having to plough through all that code. Being able to use code collapse in here does help quite a bit. |