<?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[Get Scintilla HWND for an ILexer&#x2F;syntax highlighter plugin]]></title><description><![CDATA[<p dir="auto">Was looking at the possibility of doing some extra config (e.g. <code>SCI_STYLESETEOLFILLED</code> and some other style things Notepad++ hardcoded for the built in styling) and so want to send messages to the Scintilla editor control.</p>
<p dir="auto">The <code>NppData</code> struct has a <code>_scintillaMainHandle</code> and <code>_scintillaSecondHandle</code>. Anyone know of a way to determine which one owns a specific lexer instance (at the time it is being set, so changes apply to the initial rendering)?</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/12546/get-scintilla-hwnd-for-an-ilexer-syntax-highlighter-plugin</link><generator>RSS for Node</generator><lastBuildDate>Sat, 06 Jun 2026 16:27:14 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/12546.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 18 Oct 2016 16:18:16 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Get Scintilla HWND for an ILexer&#x2F;syntax highlighter plugin on Tue, 18 Oct 2016 22:08:13 GMT]]></title><description><![CDATA[<p dir="auto">Ok. I just wanted to make sure you weren’t heading down a path you didn’t need to :). Under normal situations, an external lexer can be fully contained within a plugin.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/18605</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/18605</guid><dc:creator><![CDATA[dail]]></dc:creator><pubDate>Tue, 18 Oct 2016 22:08:13 GMT</pubDate></item><item><title><![CDATA[Reply to Get Scintilla HWND for an ILexer&#x2F;syntax highlighter plugin on Tue, 18 Oct 2016 22:01:21 GMT]]></title><description><![CDATA[<p dir="auto">Ah, yes, that seems a cleaner way to get the window.</p>
<p dir="auto">If I can make it all in a separate plugin that would seem more ideal.</p>
<p dir="auto">But going to see where I end up with a personal prototype, don’t think any of it is new concepts, just finding ways to access them (e.g. how L_JS / “JavaScript (embedded)” works in the makeStyle case). I certainly don’t want to maintain a fork of either Notepad++ or SciLexer.dll (although I think they already provide all the needed tools, except maybe the specific lexers not being extendable other than copying the code) for this.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/18604</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/18604</guid><dc:creator><![CDATA[William Newbery]]></dc:creator><pubDate>Tue, 18 Oct 2016 22:01:21 GMT</pubDate></item><item><title><![CDATA[Reply to Get Scintilla HWND for an ILexer&#x2F;syntax highlighter plugin on Tue, 18 Oct 2016 21:21:54 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto">but looks like OnSwitchFile is NPPN_BUFFERACTIVATED and npp.BufferLangType[bufferid] is NPPM_GETBUFFERLANGTYPE?</p>
</blockquote>
<p dir="auto">Yep.</p>
<blockquote>
<p dir="auto">But not sure about the third line though</p>
</blockquote>
<p dir="auto">It is equivalent to <code>SendMessage(theScintillaHandle, SCI_STYLESETEOLFILLED, SCE_C_COMMENTLINE, true);</code></p>
<blockquote>
<p dir="auto">how does editor know to which of those 2 handles to send the message?</p>
</blockquote>
<p dir="auto">When the plugin catches <code>NPPN_BUFFERACTIVATED</code> it internally calls <code>NPPM_GETCURRENTSCINTILLA</code> and updates <code>editor</code> to be the appropriate scintilla handle before running the chunk of Lua.</p>
<blockquote>
<p dir="auto">Also id need to know what index above L_EXTERNAL my lexer is.</p>
</blockquote>
<p dir="auto">That I’m not sure. Haven’t done much with external lexers. You might have to use something like <code>NPPM_GETLANGUAGENAME</code> to see if the name of the language matches your external lexer’s name.</p>
<blockquote>
<p dir="auto">Will give it a go, but for now I patched in a execute(SCI_PRIVATELEXERCALL, 1, reinterpret_cast&lt;LPARAM&gt;(_hSelf)); to the end of ScintillaEditView::setExternalLexer. Just from reading all that code think I’ll end up wanting ScintillaEditView::makeStyle anyway…</p>
</blockquote>
<p dir="auto">Are you making your own plugin or a custom Notepad++ version?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/18598</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/18598</guid><dc:creator><![CDATA[dail]]></dc:creator><pubDate>Tue, 18 Oct 2016 21:21:54 GMT</pubDate></item><item><title><![CDATA[Reply to Get Scintilla HWND for an ILexer&#x2F;syntax highlighter plugin on Tue, 18 Oct 2016 20:58:57 GMT]]></title><description><![CDATA[<p dir="auto">Not really familiar with LuaScript/Python script for Notepad++, but looks like <code>OnSwitchFile </code> is <code>NPPN_BUFFERACTIVATED</code> and <code>npp.BufferLangType[bufferid]</code> is  <code>NPPM_GETBUFFERLANGTYPE</code>?</p>
<p dir="auto">But not sure about the third line though, how does <code>editor</code> know to which of those 2 handles to send the message? Also id need to know what index above <code>L_EXTERNAL</code> my lexer is. I see that being stored by <code>NppParameters</code>.</p>
<p dir="auto">I think I can listen to <code>NPPN_BUFFERACTIVATED </code> and <code>NPPN_LANGCHANGED</code> (although sent after <code>ILexer::Lex</code>, hopefully that is ok). Then maybe <code>SCI_GETLEXERLANGUAGE</code> to both windows instead of the <code>L_*</code> enum as I get a string.</p>
<p dir="auto">Will give it a go, but for now I patched in a <code>execute(SCI_PRIVATELEXERCALL, 1, reinterpret_cast&lt;LPARAM&gt;(_hSelf));</code> to the end of <code>ScintillaEditView::setExternalLexer</code>. Just from reading all that code think I’ll end up wanting <code>ScintillaEditView::makeStyle</code> anyway…</p>
]]></description><link>https://community.notepad-plus-plus.org/post/18596</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/18596</guid><dc:creator><![CDATA[William Newbery]]></dc:creator><pubDate>Tue, 18 Oct 2016 20:58:57 GMT</pubDate></item><item><title><![CDATA[Reply to Get Scintilla HWND for an ILexer&#x2F;syntax highlighter plugin on Tue, 18 Oct 2016 17:01:10 GMT]]></title><description><![CDATA[<p dir="auto">You can catch certain notifications from Notepad++ and then use <code>NPPM_GETCURRENTSCINTILLA </code> to see which handle to use.</p>
<p dir="auto">That being said…</p>
<p dir="auto">I’ve ran across this before – wanting to tweak style settings that aren’t configurable. You can easily do it with one of the scripting plugins. For example using LuaScript you could use something like:</p>
<pre><code>npp.AddEventHandler("OnSwitchFile", function(filename, bufferid)
    if npp.BufferLangType[bufferid] == L_CPP then
        editor.StyleEOLFilled[SCE_C_COMMENTLINE] = true
    end
end)
</code></pre>
<p dir="auto">Also easily doable with PythonScript if you are familiar with it.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/18583</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/18583</guid><dc:creator><![CDATA[dail]]></dc:creator><pubDate>Tue, 18 Oct 2016 17:01:10 GMT</pubDate></item></channel></rss>