Is it possible to mark code so as to add custom entries to BBEdit's "Functions" menu?

5

I remember back in my CodeWarrior days, it was possible to add entries to the code navigational menu using #pragma mark directives, which made it easy to organize your code file into sections visible in the menu.

Is there any such way to do this in BBEdit, specifically in JavaScript files?

enter image description here

devios1

Posted 2011-06-24T13:41:08.100

Reputation: 685

Voted to close and move to Stack Overflow - that's where the programmers hang out. – Linker3000 – 2011-06-24T16:31:02.457

It's not really a programming question though, so I didn't want to post there. It's really just a question about the BBEdit application. – devios1 – 2011-06-25T22:32:33.197

Answers

3

BBEdit supports #pragma mark for non-C languages, actually.

See the entry on the bbedit-hints blog on this topic.

Also: some other prefixes work (TODO, for example).

RyanWilcox

Posted 2011-06-24T13:41:08.100

Reputation: 323

Brilliant! That's exactly what I was looking for! – devios1 – 2011-11-28T14:49:03.560

Omg it even supports divider lines with "#mark -"! Amazing! :) – devios1 – 2011-11-28T14:51:46.210

0

Well it's not an ideal solution, but I did find a way to add bookmarks to a file by parsing it with a regular expression. You can then start lines with a certain character sequence that you want to represent a mark.

enter image description here

(Here I'm using a triple-slash to identify a bookmark.)

The problem is you have to run this manually each time you want to build the menu--it doesn't update automatically.

It also doesn't support "-" divider lines like CodeWarrior used to. Bummer.

devios1

Posted 2011-06-24T13:41:08.100

Reputation: 685