Jwing28 / zen-coding

Automatically exported from code.google.com/p/zen-coding
0 stars 0 forks source link

Dollar sign in snippets FAIL #118

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm using Zen.Coding-Aptana.v0.6.0.1 with Aptana Studio build: 
2.0.0.1256072654

I'm trying to create some usefull code snippents in my_zen_settings.js 
file like this:

var my_zen_settings = {
    'html': {
        'abbreviations': {
            'jq': '<script type="text/javascript" src="http://
ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>',
            'demo': '<div id="demo"></div>'
        },
        'snippets': {
            'db:e': "\$db->execute('|');",
            'db:o': "\$db->open('|');",
            'db:a': "\$|=\$db->fetchArray();",
            'db:f': "\$|=\$db->fetchRowsAll();",
            'dbe': "$$db->execute('|');",
            'dbo': "$$db->open('|');",
            'dba': '$$|=$$db->fetchArray();',
            'dbf': "$$|=$$db->fetchRowsAll();"
        }
    }
};

When I try to expand the following snippets I get unpredictable results:

dbe => 1db->execute('');
dba => $=1db->fetchArray();
dbf => $=1db->fetchRowsAll();
dbo => 1db->open('');

Where does this 1 come from and how could it be fixed?

Original issue reported on code.google.com by aldekein...@gtempaccount.com on 25 Feb 2010 at 4:14

GoogleCodeExporter commented 9 years ago
ZC uses $ as item enumerator. It should be outputted "as is" when escaped like 
this: \$
Confirm this bug.

Original comment by serge....@gmail.com on 25 Feb 2010 at 4:42

GoogleCodeExporter commented 9 years ago
Sorry, is there any progress in fixing this bug?

Original comment by aldekein...@gtempaccount.com on 11 Mar 2010 at 3:42

GoogleCodeExporter commented 9 years ago
Neither \$ nor $$ work, using same version of Zen Coding for Aptana version 
2.0.4.

I suggest having ${dollar} output the dollar sign.

Original comment by hubatt@gmail.com on 1 Apr 2010 at 2:28

GoogleCodeExporter commented 9 years ago
Should be fixed in developer preview: 
http://wiki.github.com/sergeche/zen-coding/release-notes
Dollar sign must double-escaped: 'db:e': '\\$db->execute()'

Original comment by serge....@gmail.com on 3 May 2010 at 3:17

GoogleCodeExporter commented 9 years ago
Will this change be replicated into the Notepad++ source at some point? I'm 
glad to see 
this fix - will make my life so much easier working with Zend Framework/phtml 
templates.

Original comment by davidwle...@gmail.com on 4 May 2010 at 6:49

GoogleCodeExporter commented 9 years ago
The latest N++ plugin should contain that fix. 

Original comment by serge....@gmail.com on 4 May 2010 at 7:00

GoogleCodeExporter commented 9 years ago
Was hard to find this topic.

In dreamweaver espacing like this works: \\$

Original comment by baranyai...@gmail.com on 3 Jan 2013 at 2:12