Procedure Folding

Post your Gambas programming questions here.
Post Reply
User avatar
grayghost4
Posts: 187
Joined: Wednesday 5th December 2018 5:00am
Location: Marengo, Illinois usa

Procedure Folding

Post by grayghost4 »

Procedure Folding is a great way to temporarily hide clutter in your editor.

First of all go to menu Tools > Preferences > Editor and ensure that Procedure Folding is enabled.


In the code Editor, click on the minus (-) to the left of the procedure to fold it. All text in the procedure will now be hidden, with just the procedure declaration and a plus sign (+) visible.
In the past this has worked .... now it will not work ?
the "-" shows up but when I click on it nothing happenes.
could it be related to the components I have chosen ?
User avatar
cogier
Site Admin
Posts: 1125
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: Procedure Folding

Post by cogier »

Try [Ctr]+[Alt]+[Enter] to fold all the routines, or [Ctr]+[Enter] for a single routine.

All working fine here on 3.16.3 Stable.

Image
User avatar
grayghost4
Posts: 187
Joined: Wednesday 5th December 2018 5:00am
Location: Marengo, Illinois usa

Re: Procedure Folding

Post by grayghost4 »

That works ... thanks

That makes the program seem much more manageable :lol:
User avatar
stevedee
Posts: 518
Joined: Monday 20th March 2017 6:06pm

Re: Procedure Folding

Post by stevedee »

grayghost4 wrote: Friday 10th December 2021 1:57pm ...In the past this has worked .... now it will not work ?
the "-" shows up but when I click on it nothing happens...
Yes I'm sure its changed. You now need to hold down <shift> while clicking the + or -
User avatar
cogier
Site Admin
Posts: 1125
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: Procedure Folding

Post by cogier »

stevedee wrote: Friday 10th December 2021 4:32pm
Yes I'm sure its changed. You now need to hold down <shift> while clicking the + or -
I have just tried again, and I don't need the [Shift] key, just a click on the minus sign does the job.
User avatar
stevedee
Posts: 518
Joined: Monday 20th March 2017 6:06pm

Re: Procedure Folding

Post by stevedee »

cogier wrote: Friday 10th December 2021 4:45pm ...just a click on the minus sign does the job.
Thanks Charlie, there must be something odd about my system...and I've already changed the original Did You Know post!

edit: actually, if grayghost4 has the same problem, then its not just me.
User avatar
grayghost4
Posts: 187
Joined: Wednesday 5th December 2018 5:00am
Location: Marengo, Illinois usa

Re: Procedure Folding

Post by grayghost4 »

Could it because using gtk vs. QT

I am using gtk


[img]file:///home/mhc/Pictures/Screenshot%20from%202021-12-10%2011-23-31.png[/img]
Attachments
Screenshot from 2021-12-10 11-23-31.png
Screenshot from 2021-12-10 11-23-31.png (32.21 KiB) Viewed 4431 times
User avatar
Quincunxian
Posts: 173
Joined: Sunday 25th June 2017 12:14am
Location: Western Australia

Re: Procedure Folding

Post by Quincunxian »

The same thing happens to me intermittently.
I've been searching for a common factor for several months but can't find anything.
Sometimes restarting the Gambas instance helps, sometimes a full reboot helps.

Have been working on the same project over a long period of time, and when it happens, the Ctl-Enter solution always works as the fall-back.
Given that it's the same project and the components haven't changed since the start, logic would dictate that it's not a GTK / QT thing.

For any given project, you will have a .settings file in the project folder.
At the bottom of this file, will be a [OpenFile] entry. This shows all open files in the GUI and their fold settings.
This is a copy of a current project of mine.
The folder number as shown is the 'blank' number that has the displayed line between code Subs & Functions.
With this example line [ File[7]=".src/Cls_ToolBox_Folders.class:3.56" ] I'm not sure what the '3.56' relates to ?
[OpenFile]
Count=7
Active=7
File[1]=".src/Frm_Main.form"
File[2]=".src/Frm_Main.class:2.1250"
Fold[2]=[72,78,85,190,200,297,317,452,599,650,785,946,1022,1094,1106,1117,1130,1158,1164,1188,1225,1234,1241,1250,1261,1277,1285,1291,1302,1309,1319,1325,1334,1342,1348,1354,1360,1366,1372,1381,1401,1412,1425,1433,1446,1455,1470,1476,1482,1496,1505,1516,1522,1532,1542,1560,1566,1610,1616,1628,1634,1644,1660,1667,1676,1682,1688,1694,1717,1743,1762,1769,1775,1789,1803,1809]
File[3]=".src/Frm_HelpMenu.form"
File[4]=".src/Cls_ToolBox_Forms.class:37.209"
File[5]=".src/AE.module:0.148"
File[6]=".src/AG.module:28.38"
File[7]=".src/Cls_ToolBox_Folders.class:3.56"
Fold[7]=[0,30,36,56]
I've tried to find something wrong, but it all appears to be working as it should be. All the forms/line numbers match up.
I have a feeling that it's in the code directly related to the GUI editor.
Cheers - Quin.
I code therefore I am
User avatar
BruceSteers
Posts: 1565
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: Procedure Folding

Post by BruceSteers »

Quincunxian wrote: Friday 10th December 2021 8:52pm With this example line [ File[7]=".src/Cls_ToolBox_Folders.class:3.56" ] I'm not sure what the '3.56' relates to ?
Cursor position i think
If at first you don't succeed , try doing something differently.
BruceS
User avatar
Quincunxian
Posts: 173
Joined: Sunday 25th June 2017 12:14am
Location: Western Australia

Re: Procedure Folding

Post by Quincunxian »

Yeah I thought that too, but when I checked, the cursor was on a different line.
There may be some 'offset' involved though.

I placed the cursor at line 130 at column 2, then did a full save.
This is the line in the file : File[4]=".src/Cls_ToolBox_Forms.class:37.209"
Moved the tab in GUI and that had no effect either.

{working on this while posting}

Set the cursor to 1:372
Closed the Gambas instance then reopened it and the cursor was set to an offset of 1 on each.
File[3]=".src/Cls_ToolBox_Forms.class:2.373"

So it is a cursor position, but only updates when closing the instance - which appears a bit strange.
I also tried setting the cursor position to somewhere else, saving and then closing the tab for the class.
The cursor appears when I left it when opening the file for edit again - which means that is being saved elsewhere.
The .settings file was unchanged - seems to be a state save when the Gambas GUI interface is closed.
Cheers - Quin.
I code therefore I am
Post Reply