A few questions for the snippets
Posted: 09 March 2011 04:06 AM   [ Ignore ]
Newbie
Rank
Total Posts:  4
Joined  2011-03-08

1) How add new line in snippets. Return (Enter) not working.
2) How can I override the default snippets. For example:

if ()
{

to

if () {

Profile
 
 
Posted: 09 March 2011 12:34 PM   [ Ignore ]   [ # 1 ]
Moderator
RankRankRankRank
Total Posts:  1252
Joined  2008-10-28

Probably the nicest way to get newlines and indentation in snippets is to create the snippet in a new window, and copy and paste it into the snippets box.

However, if you want to enter a linebreak or tab character directly into the snippet window, hold down option while you hit the return or tab key.

The “if” snippet is probably a PHP snippet. Currently the only way to modify that is to override the PHP.sugar according to these instructions:

http://wiki.macrabbit.com/index/Override_default_sugars/

For step #4 instead of changing the Languages.xml file, you will want to modify this file:

PHP.sugar/TextActions/Snippets.xml

The relevant snippets are inside the <text> elements. Here’s some documentation for the XML and snippet syntax if you are confused by the file layout:

http://wiki.macrabbit.com/index/Snippets/
http://wiki.macrabbit.com/index/SnippetSyntax/

 Signature 

Ian Beck
MacRabbit Support

Follow us on Twitter, or try my custom themes: Quiet Light & Earthworm

Profile
 
 
Posted: 09 March 2011 01:31 PM   [ Ignore ]   [ # 2 ]
Newbie
Rank
Total Posts:  4
Joined  2011-03-08

Very good. I like Espresso!

Profile