Page 1 of 1

useful 'Issues' and 'Folding' tricks

Posted: Wed Oct 07, 2015 5:09 pm
by Blue
:idea: *** A quickly modifiable coloured label *** :idea:
*** IMPORTANT : i forgot to mention that i'm using PB 5.31 x86 on Windows x64.
                          Not yet tested in PB 6.40
correction 1 : :oops: ... i meant 5.31 and 5.40, of course (Vade retro, Alzheimer...)
correction 2 : Guided by laziness, i simply copied/pasted my explanation lines below;
which made me forget to specify that you HAVE
to UNCHECK the "Show in Issue Tool" option for the second entry, to avoid duplicate labels in the issue browser.

Here is a small trick easily achieved via the fabulous "Issues" tool provided with the PureBasic IDE.
The "Issues" tool, as we all know, allows to quickly navigate through the 39 modules and 65 files of your BIG project...
and it works for small 1-file projects too :wink:

We can make full use of its built-in flexibility with a very simple trick.
Here's how:

step 1 : -----------------------------------------------------------
In the Issues editor of the Preferences file, add a [ New ] issue :

issue name : here
reg. expr. : ::.* <-- hard to read ? it is: colon + colon + period + asterisk
priority : normal
color : yellow <-- my friend RASHAD's favourite ! :lol:

- Select 'Change issue background' to produce a coloured label
- Check 'Show in issue tool' <--- Quick jump to the label. Great feature !
- Click on [Update] to save your choices <-- don't forget !
--------------------------------------------------------------------------
step 2 : ----------------------------------------------------------------
Reproduce the above "issue" by selecting it and then clicking on [ New ] issue again:

issue name : here: <-- same name, with some character appended. I use a colon.
reg. expr. : :: .* <-- hard to read ? it is: colon + colon + SPACE + period + asterisk :idea:
priority : normal <-- no need to change this
color : yellow <-- none needed : whatever you choose, it will be the same as the previous one !

- Select 'Change issue background' to produce a coloured label
- UNCheck 'Show in issue tool'    <-- to avoid duplicate labels
- Check 'Show in procedure browser' <-- this implements the trick :idea:
Click on [Update] to save your choices
--------------------------------------------------------------------------

You get the usual when you write
; a comment ::module X does this and that <-- displayed and colored by 'Issues' browser
; another comment ::54 : important ! <-- displayed and colored by 'Issues' browser

but now it can quickly be made to ALSO appear in the 'Procedure' browser by simply adding a space after the double colons :
; a comment :: module X does this and that <-- displayed and colored by 'Issues' browser
; another comment :: 54 : important ! <-- displayed and colored by 'Issues' browser
Same comments, but now both visible in the 'Procedure' browser

So very little effort required to add/remove a label, at will, in the Procedure browser.

And it will prove soooooooo useful when debugging.

Of course, for all those who write bug-free code :shock:, this will prove pointless.
But for the rest of us, it is priceless. :oops:


[Addendum]
And while you're finessing in your 'Preferences' file, why not get the 'Issues' and 'Folding' features working together to make your coding life easier? After implementing the 'Issues' patterns suggested above, jump to the [Editor/Folding] section and add
Start Keyword : ;: <-- Unreadable ? That's semi-colon + colon
  End Keyword : ;. <-- Unreadable ? That's semi-colon + period

With this, you end up with a colourful folding 'label' that you can, at will, display/hide in the Procedure browser.

Combining these 2 IDE useful Editor features adds powerful navigating features to the Editor and greatly help to find at a glance where's what in your 12-files and 6000-lines project source files. Unfortunately, the 'Issues' highlighting does not work on lines that start with the built-in folding symbol (;-) (minus sign).

[Change]
I changed my early suggestion of    : label :   to   :: label   because using the space bar as a modifier is much faster than inserting another colon. (for me, anyway)
But, of course, it's only the idea that matters here.
Use whatever symbol is within easy reach for you, on your national keyboard.

 

Re: Simple & useful "issues" trick

Posted: Wed Oct 07, 2015 5:19 pm
by Keya
It is a SUPER USEFUL feature ive used ever since i accidentally discovered it after typing 'TODO' in-comment, where I thought i'd stumbled upon an undocumented feature lolll :oops: :) :)

Re: Simple & useful "issues" trick

Posted: Wed Oct 07, 2015 7:33 pm
by davido
@Blue,
Very clever.
I'll find this most useful as I tend to write code-free bugs.

Re: Simple & useful "issues" trick

Posted: Wed Oct 07, 2015 9:18 pm
by Blue
davido wrote:I'll find this most useful as I tend to write code-free bugs.
:lol: :lol: :lol:
Welcome to the Club. 8)

Re: useful 'Issues' and 'Folding' tricks

Posted: Thu Oct 08, 2015 9:48 am
by HanPBF
Nice trick! Thanks!

Two problems:
- issue is shown twice at my site
- many commented code blocks

Code: Select all

; X=1:Y=0:Z=1
are now also in the issue browser (o.k., commented code shall be deleted...)

But at least really great hint to the regular expression function of the issue tool!
Thanks!

Re: useful 'Issues' and 'Folding' tricks

Posted: Thu Oct 08, 2015 10:59 am
by IdeasVacuum
*** IMPORTANT : i forgot to mention that i'm using PB 6.31 x86 on Windows x64.
Not yet tested in PB 6.40
Wow, I haven't spent much time on PB5.40 yet .... you are ahead of time :)

Re: useful 'Issues' and 'Folding' tricks

Posted: Thu Oct 08, 2015 12:21 pm
by Fangbeast
IdeasVacuum wrote:
*** IMPORTANT : i forgot to mention that i'm using PB 6.31 x86 on Windows x64.
Not yet tested in PB 6.40
Wow, I haven't spent much time on PB5.40 yet .... you are ahead of time :)
He came from the future!!! I fell out of my chair reading his version numbers:):)

Re: useful 'Issues' and 'Folding' tricks

Posted: Thu Oct 08, 2015 1:14 pm
by ostapas
IMPORTANT : i forgot to mention that i'm using PB 6.31 x86 on Windows x64.
Not yet tested in PB 6.40
I think, the mistake was made intentionally :) Anyway, many thanks for the trick, it is also incredibly useful when using massive amount of folds inside folds(e.g., to indicate parent fold)

Re: useful 'Issues' and 'Folding' tricks

Posted: Thu Oct 08, 2015 3:48 pm
by Blue
ostapas wrote:[...]it is also incredibly useful when using massive amount of folds inside folds(e.g., to indicate parent fold)
Yes, you're absolutely right.
That's exactly the problem that led me to this solution.