Community
    • Login

    Folding function works strangely from version 7.7.

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    5 Posts 3 Posters 251 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.
    • Hy YangH
      Hy Yang
      last edited by

      Hi All,

      Folding function works strangely from version 7.7.
      Please see below image.
      npp_fold_error.png

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • PeterJonesP
        PeterJones @Hy Yang
        last edited by

        @Hy-Yang ,

        In v7.7, Notepad++ upgraded an underlying library, Scintilla, which handles things like the code folding. Many things about Scintilla improved with the upgrade. However, you have found an instance where it apparently doesn’t handle folding in mixed file types (html+is) the way you would like.

        Notepad++ is not going to downgrade Scintilla to go back to the way you like. As a result, you might choose to just stick with v7.6.6, which works the way you like, and just turn off auto update

        Hy YangH 1 Reply Last reply Reply Quote 0
        • guy038G
          guy038
          last edited by guy038

          Hello, @hy-yang, @peterjones and All,

          I don’t think that there is any change in folding behavior, concerning HTML Files

          But, while doing some tests, I notice some weird things about folding :

          The HTML text, ( certainly not valid ! ) which will be used for tests is :

          
          <script src="JS/jquery.min.js"></script>
          <p>This is a paragraph.</p>
          <p>This is a second paragraph.</p>
          <script charset="utf-8">
              $(document).ready(function() {
                  alert('1');
              });
          
              function test(val) {
                  alert('2');
              }
          </script>
          

          I simply added an empty line at the very beginning and two paragraph attributes between the two <script...> lines


          Now, follow these steps :

          • Start Notepad++ v7.9.2

          • Open a new tab

          • Run the option Language > H > HTML

          => In the Status Bar, you should see, at the leftmost part, the indication Hyper Text MArkup Language file

          • Paste the HTML text, above, in this new tab

          => You should get the text seen in the Fig. A, below. Note that the folding between lines 5 and 13 seems identical to the one that @hy-yang noticed in old N++ version 7.6.6

          • Delete the < symbol, beginning the line 2 and, immediately rewrite it

          => Folding has not changed and looks like in the Fig A below !

          • Now, delete the < symbol, beginning the line 3 and, immediately rewrite it

          => The folding, in the Fig B, is identical to the Fig A ( between lines 5 and 13 )

          • Then, delete the < symbol, beginning the line 5 and, immediately rewrite it

          => This time, in the Fig C below, folding has a better look, with the Test function considered as a specific section. Note, however, that this folding is not, exactly, what @hy-yang and me expect to, yet !

          • Finally delete the < symbol, beginning the line 4 and, immediately rewrite it

          => At last, the resulting folding, in the Fig D below, is the correct and expected one ;-))

          If, instead of working with the < symbol, beginning the lines, we would had chosen the > symbol, ending each line, we would had got, the same folding behavior !

          83f04c6a-d81f-492c-8f9b-022b121bf042-image.png

          IMPORTANT : In the picture above, I, intentionally, changed the default background of current line ( for color FF C0 C0 ) in order to easily locate the line where the < symbol is deleted and rewritten at once !


          So, seemingly, modifying the line, right above the <script>.........</script> section restores the correct folding in that section ?

          So, guys, just experiment !

          Best Regards

          guy038

          Sorry, I forgot to give my debug-info :

          Notepad++ v7.9.2   (32-bit)
          Build time : Dec 31 2020 - 03:58:36
          Path : D:\@@\792\notepad++.exe
          Admin mode : OFF
          Local Conf mode : ON
          OS Name : Microsoft Windows XP (32-bit) 
          OS Build : 2600.0
          Current ANSI codepage : 1252
          Plugins : BetterMultiSelection.dll DSpellCheck.dll mimeTools.dll NppConverter.dll NppExport.dll 
          
          Hy YangH 1 Reply Last reply Reply Quote 1
          • Hy YangH
            Hy Yang @PeterJones
            last edited by

            @PeterJones
            Thank you for your advice.

            1 Reply Last reply Reply Quote 1
            • Hy YangH
              Hy Yang @guy038
              last edited by

              @guy038
              Thank you for your hard work. :)

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