<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Problem collapsing and expanding text]]></title><description><![CDATA[<p dir="auto">NPP 7.9.4 Win10, 64Bit) updated today just to be sure.</p>
<p dir="auto">I’m working on something in HTML with Javascript embedded.<br />
Didn’t much configuring to NPP, of course selected language HTML.<br />
Also plugin Compare v2.0.1 is added.</p>
<p dir="auto">I have problems expanding/collapsing the nodes of javascript parts of my code. The symbols of the nodes appear and disappear without any reason.<br />
<img src="/assets/uploads/files/1615888759065-missing-node-symbol-here.jpg" alt="missing node symbol here.jpg" class=" img-fluid img-markdown" /></p>
<p dir="auto">My code snippet is a bit large, but I couldn’t help it:<br />
(This is proper and valid HTML-Code. Viewing in a Browser gives additional information about this problem)</p>
<pre><code>&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;
&lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
  &lt;script src="cookie-demo.js"&gt;&lt;/script&gt;
  &lt;title&gt;Demo&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
   
&lt;script&gt;"use strict";

try{
  var dummy = 42;
}
catch (e) { 
  alert("the Answer is 42");
}
  // do some editing  (insert/delete blanks) in this line to make the node at line 20 appear!
  
function explain(){
    document.writeln("This function cannot be collapsed immediately after expanding the script-node in line 10.&lt;br/&gt;");
    document.writeln("Edit line 18 to make a collapse icon visible for this function&lt;br/&gt;");
    document.writeln("Try collapsing and expanding the node in line 10 to make the node at line 20 disappear again.&lt;br/&gt;");
    document.writeln("Note: Collapsing this function will not yield the correct result: The script-node at line 10 will collapse instead.&lt;br/&gt;");
}
explain();
 
///////////////////////////////////////////////////////////////////////////////////////////
// Some 30 lines of junk below this line. Must be present, otherwise problem will diappear
///////////////////////////////////////////////////////////////////////////////////////////

function ConstructCell() {
  this.isBomb = false;         // Is the cell a bomb?
  this.isRevealed = false;     // Is it revealed?
  this.isFlagged = false;      // Does it have a bomb flag on it? (in case of disarmed bomb****
  this.isQuestion = false;     // Question mark (if its used)
  this.isDisarmed = false;     // Disarm (undo) used after hitting the bomb
  this.isScheduled = false;    // Used for (pseudo-)recursive revealing. Cell already scheduled.
                               // Used to prevent multiple scheduling of same cell.
  this.neighborBombs = 0; }    // Number of bombs surrounding this cell. (0..8)


// Variables used &amp; reset during play
var 
gameOver = false,
bombsFlagged = 0,          // Number of bombs flagged so far. (Counts flags on unrevealed cells and flags on revealed (disarmed) bombs)
cellsRevealed = 0;         // Number of cells revealed so far. (NOTE: Disarmed Bombs are in fact (shown as) revealed, but are internally not regarded as revealed cells.)

var lastClickOnMenu = false;  // Used to control smooth menu closing

var paused = false;           // Game in Pause

// Vars for the clock time
var
clockRunning  = false,     // Is it running, (i.e. tic expected)?
clockTics     = 0;         // Clock ticks every 100ms

// Undo/disarm clock variables
var
fuseBurning = false,       // did the user hit a bomb, waiting to see if they want to "undo"
fuseRemaining = 0,         // Time left to disarm (undo) hitting a bomb
disarmX = 0,               // x-pos of bomb to be disarmed
disarmY = 0;               // y-pos of bomb to be disarmed


&lt;/script&gt;

&lt;/body&gt;
&lt;/html&gt;

</code></pre>
<p dir="auto">The script included is only a dummy, but it is needed to produce the problem:<br />
cookie-demo.js:</p>
<pre><code>
function getCookie(name) {
    var search = name + "=";
}  

</code></pre>
<p dir="auto">Both scripts are also availiable at <a href="https://github.com/Harry-12345/NPP-Problem-demo-sources" rel="nofollow ugc">Github</a></p>
<p dir="auto">Any comments very appreciated.<br />
Harry</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/20890/problem-collapsing-and-expanding-text</link><generator>RSS for Node</generator><lastBuildDate>Thu, 11 Jun 2026 22:23:29 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/20890.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 16 Mar 2021 10:19:18 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problem collapsing and expanding text on Wed, 17 Mar 2021 10:54:21 GMT]]></title><description><![CDATA[<p dir="auto">Well, here I am again.</p>
<p dir="auto">I fiddled arround with this code, and I think I have a slightly better description now:</p>
<p dir="auto">The main problem seems to be the inclusion of a *.js-script with code like<br />
<strong>&lt;script src=“any_name.js”&gt;&lt;/script&gt;</strong><br />
Textual insertion of the content of such script into an ordinary section<br />
<strong>&lt;script&gt; any javascript &lt;/script&gt;</strong><br />
makes the problem vanish. So we have  workarround.</p>
<p dir="auto">The bug itself seems to behave like this:<br />
If a node of type &lt;script&gt;…&lt;/script&gt; is shown expanded, no function under this node is given a collapse button.<br />
If you do any edit to the text of the script some nodes will appear,  but only below the point of edit.<br />
If you collapse and expand the enclosing script node, the icons inside the script are unvisible again.</p>
<p dir="auto">Nodes inside the script may be functional or may misbehave: Sometimes they don’t collapse the function, but they close the whole enclosing script-node. I can’t see a rule for that.</p>
<p dir="auto">For reference:</p>
<pre><code>&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;
&lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
  &lt;script src="cookie-demo.js"&gt;&lt;/script&gt;
  &lt;title&gt;Demo8&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
   
&lt;script&gt;
"use strict";
 
function dummy1(){
var dummy=0;
} 
function dummy2(){
var dummy=0;
}  
function dummy3(){
var dummy=0;
} 
  
function explain(){
    document.writeln("Using Notepad++ no function of this script can be collapsed immediately after expanding the script-node in line 10.&lt;br/&gt;");
    document.writeln("There are no icons to be clicked between line number and the text of the line. &lt;br/&gt;&lt;br/&gt;");
    document.writeln("Any edit inside this script-node will make collapse icons visible, but only below the point of edit.&lt;br/&gt;");
    document.writeln("Collapsing and expanding the enclosing node of this script the will make the nodes disappear again.&lt;br/&gt;&lt;br/&gt;");
    document.writeln("Note: Collapsing any function inside this script (after making them appear) will not always yield the correct result: &lt;br/&gt;");
	document.writeln("Instead of closing the function desired, the enclosing script node may close.  &lt;br/&gt;");
	document.writeln("I can't find any rule that controls this behavior.&lt;br/&gt;&lt;br/&gt;");
	document.writeln("There is only one thing I'm resonably sure of:&lt;br/&gt;");
    document.writeln("The whole problem diappears if no *.js-script is included. See line 5 of the header.&lt;br/&gt;&lt;br/&gt;");
	document.writeln("(This seems to be true for Notepad++. &lt;br/&gt;");
	document.writeln("And it is at least in part validated for SciTE text editor as well. Thanks to mere-human!) &lt;br/&gt;&lt;br/&gt;");
}
explain();  

function dummy4(){
var dummy=0;
}
function dummy5(){
var dummy=0;
} 
function dummy6(){
var dummy=0 
}  

&lt;/script&gt;

&lt;/body&gt;
&lt;/html&gt;

</code></pre>
<p dir="auto">Happy Coding!</p>
<p dir="auto">Regards,<br />
Harry</p>
]]></description><link>https://community.notepad-plus-plus.org/post/64001</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/64001</guid><dc:creator><![CDATA[Harry-12345]]></dc:creator><pubDate>Wed, 17 Mar 2021 10:54:21 GMT</pubDate></item><item><title><![CDATA[Reply to Problem collapsing and expanding text on Tue, 16 Mar 2021 11:22:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mere-human" aria-label="Profile: mere-human">@<bdi>mere-human</bdi></a></p>
<p dir="auto">Thank you very much for this quick answer. Was about to append a question is anybody can reproduce the problem. Gives me much comfort that you can. :)</p>
<p dir="auto">Not only is that catch-try essential, but also the inclusion of an external js-script (done in header or in body doesn’t matter). Next thing for me to do is including other scripts not by include of a file but by textual copying the content into my main source. Could be a workarround.</p>
<p dir="auto">Will be back when done. Short of time right now…<br />
Thanks very much again.</p>
<p dir="auto">Harry</p>
]]></description><link>https://community.notepad-plus-plus.org/post/63970</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/63970</guid><dc:creator><![CDATA[Harry-12345]]></dc:creator><pubDate>Tue, 16 Mar 2021 11:22:15 GMT</pubDate></item><item><title><![CDATA[Reply to Problem collapsing and expanding text on Tue, 16 Mar 2021 10:59:53 GMT]]></title><description><![CDATA[<p dir="auto">This seems to be a Scintilla bug (a source code component that Notepad++ uses for syntax highlighting).<br />
I’ve just tried this in SciTE text editor (that also uses the Scintilla component) and it has the same issue:<br />
<img src="/assets/uploads/files/1615892247491-26b61296-cd9a-46df-b28f-900670390a03-image.png" alt="26b61296-cd9a-46df-b28f-900670390a03-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">It is interesting that if the try/catch block is removed then the collapsing buttons appear again. If I remove try/catch then undo it appears again:<br />
<img src="/assets/uploads/files/1615892228425-24fa06f4-d302-4670-9f0e-3b8f3bb33027-image.png" alt="24fa06f4-d302-4670-9f0e-3b8f3bb33027-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">If you want, you might report this bug to Scintilla:<br />
<a href="https://www.scintilla.org/ScintillaToDo.html" rel="nofollow ugc">https://www.scintilla.org/ScintillaToDo.html</a></p>
]]></description><link>https://community.notepad-plus-plus.org/post/63969</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/63969</guid><dc:creator><![CDATA[mere-human]]></dc:creator><pubDate>Tue, 16 Mar 2021 10:59:53 GMT</pubDate></item></channel></rss>