Menu

Bug ? How to change the commentLine ?

2008-12-15
2012-11-13
  • Mickael Faivre-Macon

    Hi,

    in langs.xml I try to change the commentLine for the ASP language from ' to #

    I don't use ASP, I use this mapping when editing rhtml.
    rhtml contains Ruby style comments (#).

    But editing the langs.xml file and restarting Notepad++ does nothing.
    Even removing the commentLine tag does not remove the syntax highlighting for ASP comments ('), messing the coloring of the end of the line.

    Anyone could help ?

    Thanks,
    Mickael.

     
    • Mickael Faivre-Macon

      It does not load the keywords from the list, try removing some of them, they will be still colored.
      That's what bugging me.
      Mickael.

       
    • Harry

      Harry - 2008-12-15

      From the wiki FAQ:
      Those xml files (except langs.xml , doLocalConf.xml and asNotepad.xml which should be always in Notepad++'s installed folder) are loaded from %AppData%\Notepad++ or Notepad++'s installed folder, it depends respectively on the absence or presence of doLocalConf.xml in Notepad++'s installed folder.

      In other words, try the other directory then the one you used, you probably have a duplicate file.

       
    • Mickael Faivre-Macon

      I have the file doLocalConf.xml and I was editing the right file in %AppData%\Notepad++.
      But I also tried the one in the Notepad++ installation folder too.
      I verified with filemon, the %AppData%\Notepad++ is well read, as well as the one in the install folder....

      I can also edit asp (or any language for that matter) keywords, delete all of them if I want, the changes are not taken into account, the word are still colored.

      I don't know what to do.
      And I really don't know from what file notepad is reading the preferences....

      Thanks for any support,
      Mickael.

       
    • Fabio

      Fabio - 2008-12-16

      Are you using Windows Vista? If so, I think I know what it is. It's Vista's "Virtual Store" folder. If Notepad++ is installed in the usual C:\Program Files folder, it must get some kind of authorization in order to write to the files in that folder; the program must be "Vista aware". I think this has just been fixed with version 5.1.2, but earlier this feature wasn't present.

      Anyway, try this: go to
      C:\Users\<yourname>\AppData\Local\VirtualStore\Program Files\Notepad++. If you see some files there, then that's the problem. Edit the files in this folder, and not the ones in the real folder, to see that changes take effect.

      This is all due to a security feature introduced by Vista: its purpose is not letting programs access data they are not authorized to, to prevent malware from damaging you, so if a program wants to modify a file without having the authorization, it modifies the copy in the virtual store folder. Unfortunately, this feature isn't widely known, so people get a terrible headache when they have to deal with it, which is exactly what happened to me, only slightly different: I was downloading plugins to N++'s folder, and then I didn't see them using Windows Explorer or any other file manager.

      To solve it, an easy way is moving Notepad++ from C:\Program Files\Notepad++ to C:\Notepad++; this one is a "standard" folder and is not protected by the virtual store.

      If you are not using Vista, or if this doesn't solve it, I'm sorry but I don't have any other ideas on what it might be.

       
    • Mickael Faivre-Macon

      I am using XP :)

       
    • Harry

      Harry - 2008-12-16

      I misread your question, what you want is not possible.
      I assumed you meant the block comment feature (adding a block of comment lines) which uses that attribute. However, the syntax highlighter has this hardcoded and does not make use of it. Afaik there is no way around it.

       
    • Mickael Faivre-Macon

      Well, why adding a commentLine attribute, and a keyword tag in a xml configuration file if it's not used ?
      I tried adding a new language, and it does not works either, so I think you're right, but I find that kind of strange.

      Thanks anyway,
      Mickael.

       
    • Harry

      Harry - 2008-12-17

      The commentLine tag is used by Notepad++ itself to add comments (as in text). The lexer (Scintilla) colors the text based on the keywords (which it loads from the list) and some hardcoded strings (like comments).

       
  • Patrick

    Patrick - 2010-08-04

    Hello Mick,

    Did you find anything new related to that topic ?
    I am trying to modify the commentLine value for LISP (I want "#" instead of ";" to start my comment lines) but it does not work.
    I have modified langs.xml and langs.model.xml but when I restart Notepad++, no change. My comments that start with ";" are highlighted but not the ones starting with "#".

    If you found a way to make it work, I'd appreciate the help.

    Patrick

     
  • cchris

    cchris - 2010-08-04

    There is a way, but its a bit heavyweight:
    1/ Edit the LexLISP.cxx Scintilla source file, and change # to ; in the ColouriseLISPDoc() function (or similar)
    2/ Rebuild SciLexer.dll

    The bad news is that this is the only practical way.

    CChris

     
  • Patrick

    Patrick - 2010-08-04

    Thanks CChris.

    Can't do it (I don't have VC++ to rebuild the dll) but I can live with that. Still, I'm surprised there is an xml file but they don't bother use it. My guess is they'll do it later.

    Patrick