<?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[New UserDefinedLang - code fold must begin at margin]]></title><description><![CDATA[<p dir="auto">NPP version: 7.7.1<br />
UDL ver 2.1.0.12</p>
<p dir="auto">I am creating a user-defined-language and am having trouble with the code-folding definitions.  Most of the UDL is working great, but it would be great to get the subroutines folding, since I have over a hundred of them.</p>
<p dir="auto">In this language, subroutines are defined as in this example:</p>
<p dir="auto">:MySubTitle<br />
code line here<br />
code line here<br />
code line here<br />
Return</p>
<p dir="auto">I wish to fold between the : and the word Return (the subroutine’s title could be any string of chars).  Problem: the concat character is also a colon (:) – and these can be found anywhere in the code. Also, the word Return could be found at other places within a subroutine. If either of these cases is true, the code folding goes completely bonkers – for example if a colon ( : ) character is encountered anywhere inside a subroutine (and since the colon is the concat character, this happens a lot). So basically, I cannot code fold the subroutines – see the screenshot at end of this message).</p>
<p dir="auto">In this language, note that subroutine :Label / Return are <em>always</em> at the left margin (or indented one tab). In fact, it would be just fine if code-folding required the subroutine start/end to be found at the beginning of the line (not indented at all).</p>
<p dir="auto">So, is it possible to tell NPP that the code-fold triggers are ONLY valid if found at the beginning of the line (or after some whitespace) ? If not, can this be made into a feature request? Note that I do not have a “Prefix Mode” checkbox anywhere in the “Folding in code N style” groups (“Folder &amp; Default” tab) - see below screenshot.</p>
<p dir="auto"><img src="https://camo.nodebb.org/f187a603bdddf67557fcf828e53bb798bebe3ac5?url=https%3A%2F%2Fi.imgur.com%2F86lCVaQ.jpeg" alt="screenshot" class=" img-fluid img-markdown" /></p>
<p dir="auto">Again, my version info is:<br />
NPP version: 7.7.1<br />
UDL ver 2.1.0.12<br />
-–<br />
<em>moderator fixed the image link so the image was embedded</em></p>
]]></description><link>https://community.notepad-plus-plus.org/topic/18337/new-userdefinedlang-code-fold-must-begin-at-margin</link><generator>RSS for Node</generator><lastBuildDate>Sat, 13 Jun 2026 00:24:13 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/18337.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 05 Oct 2019 23:41:54 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to New UserDefinedLang - code fold must begin at margin on Tue, 05 Jul 2022 13:02:25 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/gibberishbc" aria-label="Profile: gibberishbc">@<bdi>gibberishbc</bdi></a></p>
<p dir="auto">This is indeed an older thread, your recent threads are others.</p>
<p dir="auto">As for the fake return statement, assuming a language doesn’t have start and end tokens like <code>if</code> and <code>endif</code> but does have comments, which is the case in most programming languages, you could use the start token <code>if</code> and a end token like <code>#endif</code>, where <code>#</code> is actually a comment.<br />
This way, the language itself is still happy when it is executed, and npp (or UDL) knows where to break.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/78147</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/78147</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Tue, 05 Jul 2022 13:02:25 GMT</pubDate></item><item><title><![CDATA[Reply to New UserDefinedLang - code fold must begin at margin on Mon, 04 Jul 2022 14:50:11 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ekopalypse" aria-label="Profile: Ekopalypse">@<bdi>Ekopalypse</bdi></a><br />
Thanks  - good suggestion.</p>
<p dir="auto">I don’t understand the closing suggestion, though.  What do you mean “fake the<br />
return statement with an added comment tag” ?  What would that look like, or can you link me to another post that explains?</p>
<p dir="auto">Many thx !</p>
<p dir="auto"><em>PS - This question was created/posted yesterday, but I see it is timestamped Oct 7, 2019.  Any idea what might have happened?  ALSO, I responded (and am now editing) using the Brave browser - and it is working correctly (I see the SUBMIT button so it should save correctly). Ignore my comment from yesterday on my other post (will update)</em></p>
]]></description><link>https://community.notepad-plus-plus.org/post/78109</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/78109</guid><dc:creator><![CDATA[gibberishbc]]></dc:creator><pubDate>Mon, 04 Jul 2022 14:50:11 GMT</pubDate></item><item><title><![CDATA[Reply to New UserDefinedLang - code fold must begin at margin on Mon, 07 Oct 2019 10:44:12 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/gibberishbc" aria-label="Profile: gibberishbc">@<bdi>gibberishbc</bdi></a> said in <a href="/post/47592">New UserDefinedLang - code fold must begin at margin</a>:</p>
<blockquote>
<p dir="auto">:MySubTitle<br />
code line here<br />
code line here<br />
code line here<br />
Return</p>
</blockquote>
<p dir="auto">Afaik, jein, you can, if this is possible on your side, create multiple opens,<br />
to be exact - for each letter an open folder tag like :A :B :C … and fake the<br />
return statement with an added comment tag. This might work.</p>
<p dir="auto">To address feature requests, see <a href="https://community.notepad-plus-plus.org/topic/15741/faq-desk-feature-request-or-bug-report">here</a>.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/47632</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/47632</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Mon, 07 Oct 2019 10:44:12 GMT</pubDate></item></channel></rss>