• Login
Community
  • Login

UDL comment entries.

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
16 Posts 2 Posters 1.4k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P
    PeterJones @pasha-19
    last edited by PeterJones Feb 17, 2022, 4:29 PM Feb 17, 2022, 4:27 PM

    @pasha-19 ,

    I created a new language called “Pasha”. I set Comment Line Style Open to #, and Comment Style Open=/* and Close=*/.

    17270c01-728a-4d43-b799-2ec2eebc9b06-image.png

    I then exited Notepad++ to get it to save, then opened the XML. I correctly see:

    ...
        <UserLang name="Pasha" ext="" udlVersion="2.1">
            <Settings>
                <Global caseIgnored="no" allowFoldOfComments="no" foldCompact="no" forcePureLC="0" decimalSeparator="0" />
                <Prefix Keywords1="no" Keywords2="no" Keywords3="no" Keywords4="no" Keywords5="no" Keywords6="no" Keywords7="no" Keywords8="no" />
            </Settings>
            <KeywordLists>
                <Keywords name="Comments">00# 01 02 03/* 04*/</Keywords>
    ...
    

    So it is populating for me. So I don’t know what you are doing wrong that it “appears NOT TO MAKE IT INTO”.

    P 1 Reply Last reply Feb 17, 2022, 4:39 PM Reply Quote 2
    • P
      PeterJones @pasha-19
      last edited by PeterJones Feb 17, 2022, 4:36 PM Feb 17, 2022, 4:35 PM

      @pasha-19 ,

      And in this example, I can make Folding In Comment work.

      bf03eafe-03a6-40b0-9ad8-21032117c0a4-image.png

      <NotepadPlus>
          <UserLang name="Pasha" ext="" udlVersion="2.1">
              <Settings>
                  <Global caseIgnored="no" allowFoldOfComments="no" foldCompact="no" forcePureLC="0" decimalSeparator="0" />
                  <Prefix Keywords1="no" Keywords2="no" Keywords3="no" Keywords4="no" Keywords5="no" Keywords6="no" Keywords7="no" Keywords8="no" />
              </Settings>
              <KeywordLists>
                  <Keywords name="Comments">00# 01 02 03/* 04*/</Keywords>
                  <Keywords name="Numbers, prefix1"></Keywords>
                  <Keywords name="Numbers, prefix2"></Keywords>
                  <Keywords name="Numbers, extras1"></Keywords>
                  <Keywords name="Numbers, extras2"></Keywords>
                  <Keywords name="Numbers, suffix1"></Keywords>
                  <Keywords name="Numbers, suffix2"></Keywords>
                  <Keywords name="Numbers, range"></Keywords>
                  <Keywords name="Operators1"></Keywords>
                  <Keywords name="Operators2"></Keywords>
                  <Keywords name="Folders in code1, open"></Keywords>
                  <Keywords name="Folders in code1, middle"></Keywords>
                  <Keywords name="Folders in code1, close"></Keywords>
                  <Keywords name="Folders in code2, open"></Keywords>
                  <Keywords name="Folders in code2, middle"></Keywords>
                  <Keywords name="Folders in code2, close"></Keywords>
                  <Keywords name="Folders in comment, open">CommentFolderOpen</Keywords>
                  <Keywords name="Folders in comment, middle"></Keywords>
                  <Keywords name="Folders in comment, close">CommentFolderClose</Keywords>
                  <Keywords name="Keywords1"></Keywords>
                  <Keywords name="Keywords2"></Keywords>
                  <Keywords name="Keywords3"></Keywords>
                  <Keywords name="Keywords4"></Keywords>
                  <Keywords name="Keywords5"></Keywords>
                  <Keywords name="Keywords6"></Keywords>
                  <Keywords name="Keywords7"></Keywords>
                  <Keywords name="Keywords8"></Keywords>
                  <Keywords name="Delimiters"></Keywords>
              </KeywordLists>
              <Styles>
                  <WordsStyle name="DEFAULT" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
                  <WordsStyle name="COMMENTS" fgColor="008080" bgColor="FFFFFF" fontStyle="0" nesting="0" />
                  <WordsStyle name="LINE COMMENTS" fgColor="008040" bgColor="FFFFFF" fontStyle="0" nesting="0" />
                  <WordsStyle name="NUMBERS" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
                  <WordsStyle name="KEYWORDS1" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
                  <WordsStyle name="KEYWORDS2" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
                  <WordsStyle name="KEYWORDS3" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
                  <WordsStyle name="KEYWORDS4" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
                  <WordsStyle name="KEYWORDS5" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
                  <WordsStyle name="KEYWORDS6" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
                  <WordsStyle name="KEYWORDS7" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
                  <WordsStyle name="KEYWORDS8" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
                  <WordsStyle name="OPERATORS" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
                  <WordsStyle name="FOLDER IN CODE1" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
                  <WordsStyle name="FOLDER IN CODE2" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
                  <WordsStyle name="FOLDER IN COMMENT" fgColor="000000" bgColor="FFFF80" fontStyle="0" nesting="0" />
                  <WordsStyle name="DELIMITERS1" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
                  <WordsStyle name="DELIMITERS2" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
                  <WordsStyle name="DELIMITERS3" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
                  <WordsStyle name="DELIMITERS4" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
                  <WordsStyle name="DELIMITERS5" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
                  <WordsStyle name="DELIMITERS6" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
                  <WordsStyle name="DELIMITERS7" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
                  <WordsStyle name="DELIMITERS8" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
              </Styles>
          </UserLang>
      </NotepadPlus>
      
      1 Reply Last reply Reply Quote 2
      • P
        PeterJones @PeterJones
        last edited by Feb 17, 2022, 4:39 PM

        If you want #case# to be your indicator, then you need to remember the # is the start of comment, so it doesn’t go in the Folding in Comment boxes. Here’s working with #case#, #cond#, and #esac# in the code getting interpreted properly as Folding in Comments:

        445638e9-368e-4ed9-8426-b0088add65c5-image.png

        1 Reply Last reply Reply Quote 2
        • P
          PeterJones @pasha-19
          last edited by PeterJones Feb 17, 2022, 4:52 PM Feb 17, 2022, 4:51 PM

          BTW: my general procedure for starting a new UDL: I open the dialog, immediately Save As… and give it a name (without having made any settings yet). Then I Export… into the userDefineLangs\ directory. Then I Remove it. I know, that doesn’t make intuitive sense, but this is because I want the UDL in its own file, rather than in the old userDefineLang.xml contains-all-UDLs file. I then restart Notepad++, and it reads the definition from the userDefineLangs\ directory, so it’s available again. Then I start editing the UDL.

          You don’t have to do it that way… but that’s just how I do it.

          P 1 Reply Last reply Feb 17, 2022, 5:25 PM Reply Quote 2
          • P
            pasha-19 @PeterJones
            last edited by Feb 17, 2022, 5:25 PM

            @peterjones This last comment makes great sense. I will try again. However without reloading I mapped the Markdown preinstalled dark mode to the various screens.

            yellow, green, blue, gray and purple all appear to match.

            the red appears to be missing.

            Operators $ Delimeters.png markdown(color).png Keywords lists.png Folder & Default.png Comment & Number.png

            P 1 Reply Last reply Feb 17, 2022, 5:37 PM Reply Quote 0
            • P
              PeterJones @pasha-19
              last edited by Feb 17, 2022, 5:37 PM

              @pasha-19 ,

              I already showed exactly where 3 of the 5 Comment Line Style and Comment Style settings get saved, and the other two obviously fit between.

              <Keywords name="Comments">00# 01 02 03/* 04*/</Keywords>

              The 00 maps to Comment Line Style Open; 01 and 02 to the middle and close. 03 is Comment Open and 04 is Comment Close.

              And my screenshot showed that they were properly coloring.

              I don’t know what more I can show you.

              P P 2 Replies Last reply Feb 17, 2022, 5:44 PM Reply Quote 1
              • P
                pasha-19 @PeterJones
                last edited by Feb 17, 2022, 5:44 PM

                @peterjones I thank you for your efforts.

                1 Reply Last reply Reply Quote 0
                • P
                  PeterJones @PeterJones
                  last edited by Feb 17, 2022, 5:47 PM

                  5d8d4b91-e939-4145-9c6d-389a3cddf795-image.png @peterjones

                  1 Reply Last reply Reply Quote 1
                  • P
                    pasha-19
                    last edited by Feb 17, 2022, 6:13 PM

                    I downloaded the file (001-download)
                    I extracted to an empty directory (002-extract)
                    I created an exported empty file as you wisely suggested. (003-EmptyExportedFile)
                    I removed the file I exported.
                    I restarted NP++
                    I updated three entries, ext and two comment entries (004-restartNP++_n_update)

                    here is the updated file (005-updatedfile) the ext change made it into the file the two comment entries did not.

                    Again many thanks your suggestion about creating separate files was great.005-updatedfile.png 004-restartNP++_n_update.png 003-EmptyExportedFile.png 002-extract.png 001-download.png

                    1 Reply Last reply Reply Quote 0
                    • P
                      pasha-19
                      last edited by Feb 17, 2022, 10:22 PM

                      I tried this using 4 flavors of 8.3.1 install 64 & 32 bit and portable 64 & 32 bit – they all failed for me. POSITIVE NEWS – I then tried 8.2.1 portable 64 bit it works for me just like your example. If there is a problem it appears to be in 8.3.1.

                      Thanks – looks like 8.2.1 may be the answer for me.

                      P 1 Reply Last reply Feb 21, 2022, 11:03 PM Reply Quote 1
                      • P
                        PeterJones @pasha-19
                        last edited by PeterJones Feb 21, 2022, 11:04 PM Feb 21, 2022, 11:03 PM

                        @pasha-19 ,

                        I must apologize for being obtuse.

                        After looking into this report and this issue #11239 , it looks like v8.3.1 is doing something weird with the UDL comment entries, but worked properly in v8.3 and earlier. I now think there was a regression in the UDL Comment handling in v8.3.1. Given the description you showed above – especially with the XML showing single-digit rather than double-digit in the tag value – I believe the problems you were having with Comment Line syntax are caused by the same issue.

                        Hopefully it will be fixed in the next release of Notepad++ – until then, stick with v8.2.1. And again, sorry for not groking what you were trying to say.

                        1 Reply Last reply Reply Quote 2
                        15 out of 16
                        • First post
                          15/16
                          Last post
                        The Community of users of the Notepad++ text editor.
                        Powered by NodeBB | Contributors