Folding function works strangely from version 7.7.
-
Hi All,
Folding function works strangely from version 7.7.
Please see below image.
-
@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
-
Hello, @hy-yang, @peterjones and All,
I don’t think that there is any change in folding behavior, concerning
HTML
FilesBut, 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 lines5
and13
seems identical to the one that @hy-yang noticed in old N++ version7.6.6
- Delete the
<
symbol, beginning the line2
and, immediately rewrite it
=> Folding has not changed and looks like in the
Fig A
below !- Now, delete the
<
symbol, beginning the line3
and, immediately rewrite it
=> The folding, in the
Fig B
, is identical to theFig A
( between lines5
and13
)- Then, delete the
<
symbol, beginning the line5
and, immediately rewrite it
=> This time, in the
Fig C
below, folding has a better look, with theTest
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 line4
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 !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
-
-
@PeterJones
Thank you for your advice. -
@guy038
Thank you for your hard work. :)