Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #5387

    Passiday
    Participant

    Hello,

    I have some old projects that are written in classic ASP, using JavaScript scripting language (don’t ask).

    I love to work them, using EmEditor, however syntax highlighting gives me hard time sometimes. It seems as the editor can not distinguish what scripting language should be assumed, and colors my ‘strings’ in green, because it thinks it’s a VBScript comment. However, JavaScript-style comments like “//” or “/* .. */” do not color the code green. At the same time, where the client-side script part is written, there the JavaScript coloring is correct.

    I think I am missing something here… Perhaps there should be some way to fix this erroneous behaviour? Some setting, where I can write, what Scripting language is associated with ASP?

    Thanks!

    #5388

    Yutaka Emura
    Keymaster

    Passiday wrote:
    Hello,

    I have some old projects that are written in classic ASP, using JavaScript scripting language (don’t ask).

    I love to work them, using EmEditor, however syntax highlighting gives me hard time sometimes. It seems as the editor can not distinguish what scripting language should be assumed, and colors my ‘strings’ in green, because it thinks it’s a VBScript comment. And that’s just one example.

    I think I am missing something here… Perhaps there should be some way to fix this erroneous behaviour? Some setting, where I can write, what Scripting language is associated with ASP?

    Thanks!

    Is there any options like lang=’JavaScript’ in your code?

    Can you please zip your sample ASP code and email it to tech@emurasoft.com? Thanks!

    #5389

    Passiday
    Participant

    Yes, I have reference to scripting language in the declaration:

    However, when I went on to prepare you sample with code and screenshot, I’ve found that I can not repeat the behaviour – the file was displayed wrong when opened once, but when I did selectAll+copy+paste, it looked correct. When reopened, it was again correct. I need to find a stable, repeatable bug presentation.

    #5390

    Passiday
    Participant

    Ok, I have learned how to do the trick.

    It seems like the editor keeps the last assumed scripting language in memory, and rewriting the declaration, and even reopening the file does not help to redraw the colors.

    However, if I copy the code, paste it in new document, and save it as ASP file, the editor changes it’s present assumed scripting language.

    Here are the steps for repeating the bug:

    1. Start new document (A), write the following code:

    <\%
    ‘AAAA’
    \%>
    2. Start another new document (B)
    3. Copy the code from document A to document B.
    4. Save the document B as “test.asp”
    At this point you should see the ‘AAAA’ in green.
    5. Change the scripting language in declaration to JScript in document B. The syntax coloring does not change.
    6. Save the document B. The syntax coloring does not change.
    7. Close the document B, reopen it from “recently viewed files” list. The syntax coloring does not change.
    8. Create new document C, copy the code from document B to document C (it’s not with JScript declaration). Save the document C. The syntax coloring is now updated.

    Whenever the editor has assumed the language, if I then open an ASP file, it is displayed with this assumed language coloring, not the one that could be detectable from the file declaration.

    Besides that, there are many files that are used as includes in the main file, and those do not have “@” declaration. There should be at least hacky way (ie, keyword in comments) to tell the editor what is the scripting language. Or, the default language could be set up in options somewhere, or the language could be detected with more advanced algorythm.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

Share with friends... Tweet about this on TwitterShare on FacebookShare on Google+Email this to someone