<?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[function list not working for lua script]]></title><description><![CDATA[<p dir="auto">I’ve already tried adding new code into the function .xml file, but it doesn’t seem to be working, <a href="https://www.programmersought.com/article/29494429538/" rel="nofollow ugc">this code btw</a>. Even basic functions don’t show up on the list:</p>
<pre><code>function max(num1, num2)

   if (num1 &gt; num2) then
      result = num1;
   else
      result = num2;
   end

   return result; 
end

-- calling a function
print("The maximum of the two numbers is ",max(10,4))
print("The maximum of the two numbers is ",max(5,6))
</code></pre>
<p dir="auto">I also already tried updating, and using portable versions, but nothing. Am I doing something wrong here?</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/21576/function-list-not-working-for-lua-script</link><generator>RSS for Node</generator><lastBuildDate>Sat, 18 Jul 2026 21:49:29 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/21576.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 29 Jul 2021 20:21:15 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to function list not working for lua script on Mon, 16 Aug 2021 11:47:21 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a> Your code helped me too.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/68985</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/68985</guid><dc:creator><![CDATA[Nick M]]></dc:creator><pubDate>Mon, 16 Aug 2021 11:47:21 GMT</pubDate></item><item><title><![CDATA[Reply to function list not working for lua script on Thu, 29 Jul 2021 22:58:23 GMT]]></title><description><![CDATA[<p dir="auto">Oh wow! Thanks so much! I still don’t know what worked, but as soon as I dropped your code into the functionlist folder, it clicked. Honestly, I don’t really code at all. I messed around with bots a while ago, but nowadays I just really enjoying organizing my texts using Lua on N++. I’m glad I posted, you made my day :)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/68434</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/68434</guid><dc:creator><![CDATA[Kesler Sullyvan]]></dc:creator><pubDate>Thu, 29 Jul 2021 22:58:23 GMT</pubDate></item><item><title><![CDATA[Reply to function list not working for lua script on Thu, 29 Jul 2021 20:44:01 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kesler-sullyvan" aria-label="Profile: Kesler-Sullyvan">@<bdi>Kesler-Sullyvan</bdi></a> said in <a href="/post/68431">function list not working for lua script</a>:</p>
<blockquote>
<p dir="auto">I also already tried updating, and using portable versions, but nothing.</p>
</blockquote>
<p dir="auto">That’s because the instructions at <a href="https://www.programmersought.com/article/29494429538/" rel="nofollow ugc">that site</a> were written for v7.9.0 and earlier; <a href="https://npp-user-manual.org/docs/config-files/#v7-9-1-and-later-versions" rel="nofollow ugc">v7.9.1 and newer</a> separate out each functionList configuration into a separate file.</p>
<p dir="auto">In your installed Notepad++, go to <code>%AppData%\Notepad++\functionList\</code> folder <a href="/topic/15740" title="FAQ: What is %AppData%">🛈</a>, and copy one of the other language XML files to <code>lua.xml</code>. Replace the <code>&lt;parser ...&gt;</code> section with the <code>&lt;parser ...&gt;</code> from that other site: it will look like:</p>
<pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
&lt;!-- ==========================================================================\
|
|   To learn how to make your own language parser, please check the following
|   link:
|       https://npp-user-manual.org/docs/function-list/
|
\=========================================================================== --&gt;
&lt;NotepadPlus&gt;
    &lt;functionList&gt;
        &lt;parser displayName="Lua" id="lua_function" commentExpr="--.*?$" &gt;
            &lt;!-- Basic lua table view, nested lua table not supported --&gt;
            &lt;classRange
                mainExpr="[.\w]+[\s]*=[\s]*\{"
                openSymbole="\{"
                closeSymbole="\}"
                displayMode="node"&gt;
                &lt;className&gt;
                    &lt;nameExpr expr="[.\w]+"/&gt;
                &lt;/className&gt;
                &lt;function
                    mainExpr="[.\w]+[\s]*=[\s]*['&amp;quot;]?[\w]+['&amp;quot;]?"&gt;
                    &lt;functionName&gt;
                        &lt;funcNameExpr expr=".*"/&gt;
                    &lt;/functionName&gt;
                &lt;/function&gt;
            &lt;/classRange&gt;
            &lt;!-- Basic lua functions support --&gt;
            &lt;function 
                mainExpr="(function[\s]+[.\w]+(:[\w]+)?)|([.\w]+[\s]*=[\s]*function)"
                displayMode="$className-&gt;$functionName"&gt;
                &lt;functionName&gt;
                    &lt;nameExpr expr="((?&lt;=function)[\s]+[.:\w]+)|(([.\w]+)(?=([\s]*=[\s]*function)))"/&gt;
                &lt;/functionName&gt;
                &lt;className&gt;
                    &lt;nameExpr expr="[.\w]+(?=:)"/&gt;
                &lt;/className&gt;
            &lt;/function&gt;
        &lt;/parser&gt;
    &lt;/functionList&gt;
&lt;/NotepadPlus&gt;
</code></pre>
<p dir="auto">Unlike the site says, you don’t need to check or change an <code>&lt;association&gt;</code> tag or edit the new <code>overrideMap.xml</code>, because Lua defaults to <code>lua.xml</code>.<br />
Exit Notepad++ and restart.  The source code you showed will then show functions</p>
<p dir="auto"><img src="/assets/uploads/files/1627591433933-c290bd87-700b-4040-a04d-aa34e5ee64a4-image.png" alt="c290bd87-700b-4040-a04d-aa34e5ee64a4-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.notepad-plus-plus.org/post/68432</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/68432</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Thu, 29 Jul 2021 20:44:01 GMT</pubDate></item></channel></rss>