thetooi / zen-coding

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

Notepad++:xsl snippets don't expand #160

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run Notepad++, install zen coding plug-in, restart Notepad++
2. Type wp, press Ctrl-E (Zen Coding | Expand Abbreviation) 
3.

What is the expected output? What do you see instead?
expected: <xsl:with-param name="" select="" />
instead: <wp></wp>

What version of the product are you using? On what operating system?
Using version 0.6

Please provide any additional information below.
The problem exists because the zen code javascript relies on the editor
having a XSL 'language'.  Notepad++ only has a XML 'language' (of which XSL
is defined as a separate extension).  To work-around this the 'xsl'
zen_settings array index can be changed to 'xml' and changing the language
to XML, typing wp and pressing Ctrl-E expands to the xsl:with-param as
expected.  Saving the file as an .xsl file, defaults the language to XML -
so xsl snippets will work correctly.

Original issue reported on code.google.com by ian.c.ch...@gmail.com on 4 May 2010 at 2:08

GoogleCodeExporter commented 9 years ago
1. Open nppscripting\includes\zen coding.js
2. replace 
    var know_syntaxes = {
        'html': 1,
        'css': 1,
        'xml': 1,
        'xml': 1,
        'haml': 1
    };
with
    var know_syntaxes = {
        'html': 1,
        'css': 1,
        'xml': 1,
        'xsl': 1,
        'haml': 1
    };
and 
            if (!(syntax in know_syntaxes)) {
                syntax = 'html';
            }
with
            if (syntax == 'xml' && /\.xsl(t)?$/i.test(context.files[context.file]))
                syntax = 'xsl';

            if (!(syntax in know_syntaxes)) {
                syntax = 'html';
            }
3. restart Npp

Or try attached file

Original comment by eugen.kr...@gmail.com on 11 May 2010 at 8:54

Attachments:

GoogleCodeExporter commented 9 years ago
@eugen.kremer - this works beautifully too.

Original comment by ian.c.ch...@gmail.com on 18 Jun 2010 at 12:00

GoogleCodeExporter commented 9 years ago

Original comment by serge....@gmail.com on 1 Feb 2011 at 10:56

GoogleCodeExporter commented 9 years ago
FIxed in v0.7

Original comment by serge....@gmail.com on 10 Mar 2011 at 9:28