<?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[Wrong syntax highlightning]]></title><description><![CDATA[<p dir="auto">Notepad++ 8.1.9.3<br />
In lisp file, “;|” and “|;” mark a comment block and should be displayed in comment color.<br />
But only the first line beginning with “;|” is displayed correctly and the color of the other lines looks incorrectly. Is this sa bug?<br />
It seams, that n++ interpreting “;” before “|” as a commentLine, but in union with “|” it should be interpreted as commentStart.<br />
The codeline in the lang.xml is …</p>
<pre><code>&lt;Language name="lisp" ext="lsp lisp" commentLine=";" commentStart=";|" commentEnd="|;"&gt;
</code></pre>
<p dir="auto">All other highlightnings in Lisp,lsp are right.</p>
<p dir="auto">What I’m doing wrong?<br />
Please help.<br />
Thanks</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/22390/wrong-syntax-highlightning</link><generator>RSS for Node</generator><lastBuildDate>Sun, 07 Jun 2026 23:33:39 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/22390.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 16 Jan 2022 17:11:57 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Wrong syntax highlightning on Mon, 17 Jan 2022 20:16:55 GMT]]></title><description><![CDATA[<p dir="auto"><a href="https://github.com/notepad-plus-plus/npp-usermanual/pull/306" rel="nofollow ugc">User manual PR#306</a> should clarify this in the user manual.</p>
<p dir="auto">Assuming it is accepted and merged, the new verbiage will be in the next release of the <a href="http://npp-user-manual.org" rel="nofollow ugc">npp-user-manual.org</a> website, which will likely happen soon after the next version of Notepad++ is released.</p>
<p dir="auto">Until it is merged, there is still time for further clarification if people wanted to comment on the chosen wording/explanation.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/73038</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/73038</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Mon, 17 Jan 2022 20:16:55 GMT</pubDate></item><item><title><![CDATA[Reply to Wrong syntax highlightning on Mon, 17 Jan 2022 18:55:09 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peter-szammer" aria-label="Profile: peter-szammer">@<bdi>peter-szammer</bdi></a> said in <a href="/post/73033">Wrong syntax highlightning</a>:</p>
<blockquote>
<p dir="auto">But I don’t understand why in C the commentblock with …<br />
works after all?<br />
And in Lisp …<br />
works not.</p>
</blockquote>
<p dir="auto">Because, as <a class="plugin-mentions-user plugin-mentions-a" href="/user/arkadiuszmichalski" aria-label="Profile: ArkadiuszMichalski">@<bdi>ArkadiuszMichalski</bdi></a> already said, the <code>commentLine</code>, <code>commentStart</code>, and <code>commentEnd</code> attributes in the <code>langs.xml</code> are <em>only</em> used by the “toggle line/block comments” – which means for the <strong><a href="https://npp-user-manual.org/docs/editing/#edit-menu" rel="nofollow ugc">Edit &gt; Comment/Uncomment</a></strong> menu actions:<br />
<img src="/assets/uploads/files/1642445055316-bc1d4fb6-11fe-40b4-b823-67c5a5a2edb0-image.png" alt="bc1d4fb6-11fe-40b4-b823-67c5a5a2edb0-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">The syntax highlighting is handled by a library of compiled C++ “lexer” code inside Notepad++; the lexer for C/C++ knows that <code>/* ... */</code> is a block comment and <code>//</code> is a line comment; the lexer for LISP believes that <code>#|comment|#</code> is the block-comment syntax for LISP.  The LISP lexer does <em>not</em> look at the XML attributes mentioned above when deciding what is and is not a comment, and you cannot change what the lexer considers a comment by changing those attributes in the <code>langs.xml</code> config file.</p>
<p dir="auto">If the LISP lexer implementation is wrong, then it would have to be proven wrong in the original Scintilla library implementation, then a bug reported to Scintilla (which is a completely separate project, which the Notepad++ developers have no influence over), then they would have to decide to fix it, and release a new version of the Scintilla library, and then Notepad++ developers would have to incorporate that newer version into the Notepad++ codebase.  If it happened at all, it would be a long process.  (And you would have to check; Scintilla has gone through quite a few versions since the last time Notepad++ updated, so maybe the Scintilla LISP lexer already has the updates you desire.)</p>
<p dir="auto">However, if you wanted a <em>workaround</em> until such time as Notepad++ officially considers those extra LISP notations to be comments, you can add extra highlighting to a builtin lexer (like the LISP lexer) using regexes via the PythonScript plugin in conjunction with the script <code>EnhanceAnyLexer.py</code> that <a class="plugin-mentions-user plugin-mentions-a" href="/user/ekopalypse" aria-label="Profile: Ekopalypse">@<bdi>Ekopalypse</bdi></a> shares <a href="https://github.com/Ekopalypse/NppPythonScripts/blob/master/npp/EnhanceAnyLexer.py" rel="nofollow ugc">in his github repo</a>: install PythonScript plugin using the Plugins Admin, install the script per the instructions embedded in the <a href="(https://github.com/Ekopalypse/NppPythonScripts/blob/master/npp/EnhanceAnyLexer.py)">downloaded <code>EnhanceAnyLexer.py</code> file</a>; follow the instructions in that script for customizing it with a regex to match your desired line comments – something like <code>r';\|.*?\|;'</code> as the regex to match (where the backslashes are necessary because regex engine thinks <code>|</code> means <code>LOGICAL-OR</code>, not the literal <code>|</code> character).</p>
]]></description><link>https://community.notepad-plus-plus.org/post/73037</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/73037</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Mon, 17 Jan 2022 18:55:09 GMT</pubDate></item><item><title><![CDATA[Reply to Wrong syntax highlightning on Mon, 17 Jan 2022 18:51:33 GMT]]></title><description><![CDATA[<p dir="auto">My current understanding of the lexer is that when it detects a <code>#</code>, it switches to the <code>SCE_LISP_MACRO_DISPATCH</code> state, and when the next character is a <code>|</code>, it switches to <code>SCE_LISP_MULTI_COMMENT</code>, which then resolves to <code>SCE_LISP_DEFAULT</code> when <code>|#</code> appears.<br />
Does this make sense?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/73036</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/73036</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Mon, 17 Jan 2022 18:51:33 GMT</pubDate></item><item><title><![CDATA[Reply to Wrong syntax highlightning on Mon, 17 Jan 2022 18:39:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peter-szammer" aria-label="Profile: peter-szammer">@<bdi>peter-szammer</bdi></a></p>
<p dir="auto">Ok, now I understand <a class="plugin-mentions-user plugin-mentions-a" href="/user/arkadiusz-michalski" aria-label="Profile: Arkadiusz-Michalski">@<bdi>Arkadiusz-Michalski</bdi></a>’s answer.<br />
For whatever reason, LISP and three other lexers were in the disabled languages box for me and so I didn’t see them when I checked the lexers via the languages menu, which led me to believe it was a UDL issue, which it clearly is not.<br />
Sorry for the confusion.<br />
The <a href="https://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/scintilla/lexers/LexLisp.cxx#L210" rel="nofollow ugc">LISP lexer</a> only considers |# for comment blocks.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/73035</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/73035</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Mon, 17 Jan 2022 18:39:15 GMT</pubDate></item><item><title><![CDATA[Reply to Wrong syntax highlightning on Mon, 17 Jan 2022 18:21:40 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>  … thank you for response!<br />
But: negativ<br />
Just the first line after commentStart is right, but all others not.</p>
<p dir="auto">@ ArkadiuszMichalski<br />
I know that the color are made by lexer … strange is, that only “COMMENTLINE” and “COMMENT” is available in lexer. Here “COMMENT” can only mean the commentblock. Or?</p>
<p dir="auto">But I don’t understand why in C the commentblock with …<br />
commentStart= “/<em>" commentEnd="</em>/”<br />
works after all?<br />
And in Lisp …<br />
commentStart= “;|” commentEnd=“|;”<br />
works not.<br />
Strangely laborious.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/73033</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/73033</guid><dc:creator><![CDATA[peter szammer]]></dc:creator><pubDate>Mon, 17 Jan 2022 18:21:40 GMT</pubDate></item><item><title><![CDATA[Reply to Wrong syntax highlightning on Mon, 17 Jan 2022 16:48:06 GMT]]></title><description><![CDATA[<p dir="auto">This setting is only for toggle line/block comments (not highlightning, the lexer is responsible for it). I don’t know how Lisp block comments look like, but the current lexer recognizes <code>#|comment|#</code>.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/73031</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/73031</guid><dc:creator><![CDATA[ArkadiuszMichalski]]></dc:creator><pubDate>Mon, 17 Jan 2022 16:48:06 GMT</pubDate></item><item><title><![CDATA[Reply to Wrong syntax highlightning on Sun, 16 Jan 2022 21:33:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peter-szammer" aria-label="Profile: peter-szammer">@<bdi>peter-szammer</bdi></a></p>
<p dir="auto">I would try to define both in comment style, e.g.</p>
<p dir="auto">open: <code>;| ;</code><br />
close: <code>|; ((EOL))</code></p>
]]></description><link>https://community.notepad-plus-plus.org/post/73022</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/73022</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Sun, 16 Jan 2022 21:33:19 GMT</pubDate></item></channel></rss>