<?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[Code Folding: Don&#x27;t include the closing brace in the folded text for UDL or existing language]]></title><description><![CDATA[<p dir="auto">When I fold a code level, I don’t want to also include the final, closing <code>})]</code> delimiter in the hidden part of the fold. <strong>How do I modify an existing language or UDL to include this brace folding behavior from <code>python</code>?</strong></p>
<p dir="auto">If I select <code>python</code> as the language, and fold a layer using <code>{}</code> braces, the beginning line and the final line will be shown, which allows you to use the margin select to grab the entire block cleanly. Whereas most languages will include the closing line in the hidden part of the fold, and you need to rely on a newline after a block to properly select the entire block while it’s folded.</p>
<p dir="auto"><img src="/assets/uploads/files/1776530505050-untitled.png" alt="Untitled.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">In this image, the top is <code>CSS</code> syntax, the bottom is <code>python</code> and in the <code>python</code> image, you see the code block’s closing brace is visible, but the <code>CSS</code> text, does not; the next visible line is the closing brace for the fold level <em>above this block</em>. I highlighted level 1 with green and 2 with red.</p>
<p dir="auto"><a href="https://www.youtube.com/watch?v=cvPrOKPnfD4" rel="nofollow ugc">https://www.youtube.com/watch?v=cvPrOKPnfD4</a><br />
I also made this quick demonstration of how the folds are different.</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/27497/code-folding-don-t-include-the-closing-brace-in-the-folded-text-for-udl-or-existing-language</link><generator>RSS for Node</generator><lastBuildDate>Sat, 18 Apr 2026 21:42:53 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/27497.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 18 Apr 2026 16:49:18 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Code Folding: Don&#x27;t include the closing brace in the folded text for UDL or existing language on Sat, 18 Apr 2026 21:36:35 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/3841">@PeterJones</a> Ah yah, I understand now. I suppose this is a fine solution, so thank you for that. This still requires some finesse to get in front of the 1st column versus just click+dragging inside the margin, but definitely better than before. 😎</p>
]]></description><link>https://community.notepad-plus-plus.org/post/105278</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/105278</guid><dc:creator><![CDATA[Yellow Folderzip]]></dc:creator><pubDate>Sat, 18 Apr 2026 21:36:35 GMT</pubDate></item><item><title><![CDATA[Reply to Code Folding: Don&#x27;t include the closing brace in the folded text for UDL or existing language on Sat, 18 Apr 2026 18:42:54 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/38874">@Yellow-Folderzip</a> said in <a href="/post/105269">Code Folding: Don't include the closing brace in the folded text for UDL or existing language</a>:</p>
<blockquote>
<p dir="auto">Because without a double newline after the closing brace, selecting down one row will grab the first line of the next block.</p>
</blockquote>
<p dir="auto">If you select the whole second fold line, of course it will select from that, just like with non-folded text.  If you end the selection at the beginning of the line, rather than selecting the line, then it will work as you desire.</p>
<pre><code>{
	.class1 {
		color: red;
		border: 1px solid green;
	}
	.class2 {
		
	}

}
</code></pre>
<p dir="auto">Normal (visible) text:</p>
<ul>
<li>To select one line (including EOL) of indented text when next line is indented to the same level, stop the selection at the beginning of the next line<br />
<img src="/assets/uploads/files/1776537623384-b00e8b79-e98c-46cb-a401-9a7104b721f9-image.png" alt="b00e8b79-e98c-46cb-a401-9a7104b721f9-image.png" class=" img-fluid img-markdown" /></li>
<li>To select both lines (including EOL), then stop at the beginning of the line <em>following</em> those lines.<br />
<img src="/assets/uploads/files/1776537637310-f48e4f39-7d2c-4f95-93fa-91db45e44aae-image.png" alt="f48e4f39-7d2c-4f95-93fa-91db45e44aae-image.png" class=" img-fluid img-markdown" /></li>
</ul>
<p dir="auto">Similarly, with collapsed blocks:</p>
<ul>
<li>To select just the first .class1 block when collapsed, just select to the beginning of the next line:<br />
<img src="/assets/uploads/files/1776537714617-cadc27f9-4d1b-498f-9f78-a0fb57fa199a-image.png" alt="cadc27f9-4d1b-498f-9f78-a0fb57fa199a-image.png" class=" img-fluid img-markdown" /></li>
<li>To select both, then select to the beginning of the line after:<br />
<img src="/assets/uploads/files/1776537737198-9ee2af09-ca22-4417-b470-f43eb698d094-image.png" alt="9ee2af09-ca22-4417-b470-f43eb698d094-image.png" class=" img-fluid img-markdown" /></li>
</ul>
<p dir="auto">There is no need to have a blank line between them.  Just select as much as you want to copy, exactly identical to how it works with no folded text.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/105270</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/105270</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Sat, 18 Apr 2026 18:42:54 GMT</pubDate></item><item><title><![CDATA[Reply to Code Folding: Don&#x27;t include the closing brace in the folded text for UDL or existing language on Sat, 18 Apr 2026 17:57:13 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/3841">@PeterJones</a> This is what I meant to describe by:</p>
<blockquote>
<p dir="auto">and you need to rely on a newline after a block to properly select the entire block while it’s folded</p>
</blockquote>
<p dir="auto">in the original post. Because without a double newline after the closing brace, selecting down one row will grab the first line of the next block. If I were to rely on this functionality, I would have to insert a double newline after every block, at the green arrow.</p>
<p dir="auto"><img src="/assets/uploads/files/1776534798577-1.png" alt="1.PNG" class=" img-fluid img-markdown" /><br />
<img src="/assets/uploads/files/1776534861207-2.png" alt="2.PNG" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.notepad-plus-plus.org/post/105269</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/105269</guid><dc:creator><![CDATA[Yellow Folderzip]]></dc:creator><pubDate>Sat, 18 Apr 2026 17:57:13 GMT</pubDate></item><item><title><![CDATA[Reply to Code Folding: Don&#x27;t include the closing brace in the folded text for UDL or existing language on Sat, 18 Apr 2026 17:42:45 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/38874">@Yellow-Folderzip</a> said in <a href="/post/105265">Code Folding: Don't include the closing brace in the folded text for UDL or existing language</a>:</p>
<blockquote>
<p dir="auto">That being, the ability to select the entire block and its closing brace + newline.</p>
</blockquote>
<p dir="auto">That’s easy, and doesn’t need any change to Notepad++: that happens automatically when selecting a hidden block: if you just select from the beginning of the visible line to the end, it will only select that line, with no newline (just like what happens if you select a fully visible line that way); however, if you select to the start of the next line, then it will include the entire hidden block:</p>
<p dir="auto">if I have the code</p>
<pre><code>if(condition) {
	blah;
}

</code></pre>
<p dir="auto">as here:<br />
<img src="/assets/uploads/files/1776533749770-9a8975e2-534d-41d5-b296-faeec1a6dd1d-image.png" alt="9a8975e2-534d-41d5-b296-faeec1a6dd1d-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">then hide it.</p>
<p dir="auto">If I select just to the end of the line with the <code>{</code> , then it will only select the <code>if(condition) {</code> with no newline and no contents from the block:<br />
<img src="/assets/uploads/files/1776533823134-5ff9a655-6a89-49b2-8c59-9f46a4f48afb-image.png" alt="5ff9a655-6a89-49b2-8c59-9f46a4f48afb-image.png" class=" img-fluid img-markdown" /></p>
<pre><code>if(condition) {
</code></pre>
<p dir="auto">But if I do a shift+downarrow from the start of the line, to select to the beginning of the next line:<br />
<img src="/assets/uploads/files/1776533863416-307f5e0a-1afd-4883-9655-de3efadc3d3d-image.png" alt="307f5e0a-1afd-4883-9655-de3efadc3d3d-image.png" class=" img-fluid img-markdown" /><br />
then the selected text includes the entire block, including the newline:</p>
<pre><code>if(condition) {
	blah;
}
</code></pre>
<p dir="auto">This is the same behavior as selecting fully-visible text:</p>
<ul>
<li>newline not included in selection:<br />
<img src="/assets/uploads/files/1776533931186-1eb4ea8c-b95d-4da9-a4ed-a707a04f5693-image.png" alt="1eb4ea8c-b95d-4da9-a4ed-a707a04f5693-image.png" class=" img-fluid img-markdown" /></li>
<li>newline of first line in selection:<br />
<img src="/assets/uploads/files/1776533967961-e34d7614-7537-4009-a0bc-48d9302f12cb-image.png" alt="e34d7614-7537-4009-a0bc-48d9302f12cb-image.png" class=" img-fluid img-markdown" /></li>
<li>whole block, but not final newline selected:<br />
<img src="/assets/uploads/files/1776533994634-9ecbbb38-6a10-4606-a60e-a8613a402808-image.png" alt="9ecbbb38-6a10-4606-a60e-a8613a402808-image.png" class=" img-fluid img-markdown" /></li>
<li>whole block, with final newline selected:<br />
<img src="/assets/uploads/files/1776534014608-dd1d6dd8-4d8e-4072-b59f-7ee6f6e8fe2d-image.png" alt="dd1d6dd8-4d8e-4072-b59f-7ee6f6e8fe2d-image.png" class=" img-fluid img-markdown" /></li>
</ul>
<p dir="auto">Notepad++ indicates whether the newline is selected by extending the visible selection beyond the end of the line when it is.  And if you really want to be sure, use <strong>View &gt; Show Symbol &gt; Show End of Line</strong>:</p>
<ul>
<li>EOL not selected, so not whole block:<br />
<img src="/assets/uploads/files/1776534081553-6daf1470-6af9-41da-96a7-3e86e82092e7-image.png" alt="6daf1470-6af9-41da-96a7-3e86e82092e7-image.png" class=" img-fluid img-markdown" /></li>
<li>EOL selected, so whole block is actually selected, including final EOL:<br />
<img src="/assets/uploads/files/1776534105034-d0dcc7fd-0ce3-4f7b-a705-48d530f80612-image.png" alt="d0dcc7fd-0ce3-4f7b-a705-48d530f80612-image.png" class=" img-fluid img-markdown" /></li>
</ul>
]]></description><link>https://community.notepad-plus-plus.org/post/105268</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/105268</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Sat, 18 Apr 2026 17:42:45 GMT</pubDate></item><item><title><![CDATA[Reply to Code Folding: Don&#x27;t include the closing brace in the folded text for UDL or existing language on Sat, 18 Apr 2026 17:39:58 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/3841">@PeterJones</a> This does show the closing brace on the end, but it unfortunately doesn’t do what I am looking to fix here. That being, the ability to select the entire block and its closing brace + newline.</p>
<p dir="auto"><img src="/assets/uploads/files/1776533433672-3.png" alt="3.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">The top image appears to have selected until the closing <code>}</code> brace, but when i expand the section, the bottom image shows that it has only selected the first line.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/105265</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/105265</guid><dc:creator><![CDATA[Yellow Folderzip]]></dc:creator><pubDate>Sat, 18 Apr 2026 17:39:58 GMT</pubDate></item><item><title><![CDATA[Reply to Code Folding: Don&#x27;t include the closing brace in the folded text for UDL or existing language on Sat, 18 Apr 2026 17:20:41 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/38874">@Yellow-Folderzip</a> said in <a href="/post/105260">Code Folding: Don't include the closing brace in the folded text for UDL or existing language</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/38874">@Yellow-Folderzip</a> Since i don’t know how to edit a post (can you?),</p>
</blockquote>
<p dir="auto">In general, one can edit a post using the ⋮ menu on the post:<br />
<img src="/assets/uploads/files/1776532488866-e255c5ce-08e0-49a0-81e2-902f4f81fe56-image.png" alt="e255c5ce-08e0-49a0-81e2-902f4f81fe56-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">A post is editable for 4 hours after it’s made.  (But it might require a user to get a few upvotes before they gain the edit-their-post privilege, as part of the anti-spam settings on the forum.)</p>
<blockquote>
<p dir="auto">a quick clarification for:</p>
<blockquote>
<p dir="auto">I don’t want to also include the final closing } brace or any ) delimiter</p>
</blockquote>
<p dir="auto">By “any delimiter” I mean whichever one delimiter the language happens to use, not any delim in the block.</p>
</blockquote>
<p dir="auto">My example PythonScript just assumes the <code>}</code>, so it wouldn’t work in general for you.  A more complicated script could be used that would change that default extra-text every time you change to a different file/tab/view, and choose that text based on the filetype.</p>
<p dir="auto">(But part of me is hoping, for your sake, that I’ve just not found the right message, and that there is one that allows changing whether the last line of folded text is hidden or not.  I am hoping someone else will eventually chime in…)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/105262</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/105262</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Sat, 18 Apr 2026 17:20:41 GMT</pubDate></item><item><title><![CDATA[Reply to Code Folding: Don&#x27;t include the closing brace in the folded text for UDL or existing language on Sat, 18 Apr 2026 17:14:24 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/38874">@Yellow-Folderzip</a> said in <a href="/post/105258">Code Folding: Don't include the closing brace in the folded text for UDL or existing language</a>:</p>
<blockquote>
<p dir="auto">If I select python as the language, and fold a layer using {} braces, … How do I modify an existing language or UDL to include this brace folding behavior from python?</p>
</blockquote>
<p dir="auto">Python doesn’t fold on braces.  Python folds on indentation.  So it’s not including the braces in the fold because braces have nothing to do with Python indentation.</p>
<p dir="auto">And no, you cannot set UDL to use indentation for folding; it was defined to be keyword/symbol-based for everything, including folding.  (It’s been requested in the official feature-request multiple times, and hasn’t been implemented yet.)</p>
<p dir="auto">Looking through the Scintilla documentation (Scintilla being the library that Notepad++ uses for doing things like the folding), I don’t <em>think</em> it has an option to “don’t hide the last/closing line of a fold section when folded”… and without that option, there’s nothing that Notepad++ can do to do the folding the way you want.  (However, it’s possible that I’ve missed something; one of the other Scintilla experts could chime in and let me know which SCI message would allow it.)</p>
<p dir="auto">However, as a workaround, there is a Scintilla message, <a href="https://scintilla.org/ScintillaDoc.html#SCI_SETDEFAULTFOLDDISPLAYTEXT" rel="nofollow ugc">SCI_SETDEFAULTFOLDDISPLAYTEXT</a>, which can be used to set extra text at the end of the shown fold line… so if you sent that message with “}” as the lParam, it would then do<br />
<img src="/assets/uploads/files/1776532225101-5cd606ad-ca67-442e-ac76-760d8d489ebe-image.png" alt="5cd606ad-ca67-442e-ac76-760d8d489ebe-image.png" class=" img-fluid img-markdown" />  =&gt; <img src="/assets/uploads/files/1776532233426-0d4cc434-165f-4968-bde7-3c732a8b1a0d-image.png" alt="0d4cc434-165f-4968-bde7-3c732a8b1a0d-image.png" class=" img-fluid img-markdown" /><br />
… if that’s sufficient for you, then you could use the PythonScript plugin set to <code>ATSTARTUP</code>, and in your user <code>startup.py</code>, you could have the lines</p>
<pre><code class="language-py">editor1.setDefaultFoldDisplayText("}");
editor2.setDefaultFoldDisplayText("}");
</code></pre>
<p dir="auto">which would then make it show that extra <code>}</code> at the end of the folding line when it is collapsed.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/105259</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/105259</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Sat, 18 Apr 2026 17:14:24 GMT</pubDate></item><item><title><![CDATA[Reply to Code Folding: Don&#x27;t include the closing brace in the folded text for UDL or existing language on Sat, 18 Apr 2026 16:54:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/38874">@Yellow-Folderzip</a> Since i don’t know how to edit a post (can you?), a quick clarification for:</p>
<blockquote>
<p dir="auto">I don’t want to also include the final closing } brace or any ) delimiter</p>
</blockquote>
<p dir="auto">By “any delimiter” I mean whichever one delimiter the language happens to use, not any delim in the block.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/105260</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/105260</guid><dc:creator><![CDATA[Yellow Folderzip]]></dc:creator><pubDate>Sat, 18 Apr 2026 16:54:32 GMT</pubDate></item></channel></rss>