Menu ▾ ▴

Define '#' as comment starter?

bigblop
2009-02-02
2012-11-13
  • bigblop

    bigblop - 2009-02-02

    I have made a file extension .p where I use # to comment lines. I have opened the "User ddefine dialog" created a new language for this extension. Under "Comment & Number -> comment line" I have choosen green as color and typed "#".

    But no comments starting with # are green, how do I define that a line starting with # should be green?

     
    • Harry

      Harry - 2009-02-03

      Notepad++ loads the userDefineLang.xml on startup, and saves it again on exit. If you happen to modify it manually in between, changes are lost.
      Best is to use the configurator, whatever is in that xml file, the configurator can access (after all, it is the configurator to write the xml in the first place).
      I suggest reading the info in the help file, it elaborates a bit on the "Treat keyword as symbol" option.

      Also, to remove the operator, open the user define dialog, select your language, go to the operator tab and remove it. On exit the changes will be saved.

       
    • Mario Valle

      Mario Valle - 2009-02-02

      Define # as symbol or put a blank after the #. At least this works for me.
      Ciao!
      mario

       
    • bigblop

      bigblop - 2009-02-02

      1) Selecting  "Treat keyword as symbol" just paints everything green even though I have not entered # as a symbol.

      2) Blank space after # does nothing, only if I treat it as a symbol but then its the same as above.

       
      • Mario Valle

        Mario Valle - 2009-02-02

        Sorry, I spoke too fast.
        for the R language I have:
        Comments&Numbers -> Comment line -> Treat keyword as symbol and then the # alone. Nothing else.
        I don't know if it is relevant, but I run 5.1.4 I had problems with the 5.0.x for the User Defined Languages.
        Hope it helps.

         
    • bigblop

      bigblop - 2009-02-02

      Just updated to 5.1.4 but it still does not work (did what you posted in latest post).

      Maybe its a bug that only appears on Windows Vista 64 bit.

       
    • bigblop

      bigblop - 2009-02-02

      Another thing, its not possible to make changes to a profile.

      When I created the profile to start with I defined a operator '='. If I remove that operator from the language profile and restart nodepad++ its appears again in that profile. Only solution is to create a new profile.

      ...best thing it seems is to avoid using the language configuratior so far.

       
      • Mario Valle

        Mario Valle - 2009-02-02

        This was exactly what happened to me with 5.0 on Win XP 32bits!
        What happens if you manually edit the "C:\Users\mvalle\AppData\Roaming\Notepad++\userDefineLang.xml" file?
        Beisde this, I run out of ideas.
        Good luck!
        mario

         
    • bigblop

      bigblop - 2009-02-02

      Hm now it works! Uninstalled the old version first and then installed the new version.

      Any ideas on how to create another color for strings surrounded by "string" ?