<?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[How to create a C# plugin?]]></title><description><![CDATA[<p dir="auto">I’m trying to create a plugin for Notepad++ in order to integrate NLog (like line colouring, filtering, …).</p>
<p dir="auto">For that I’ve tried to get the so-called “Demo” plugin working, but I’m having lots of troubles (see StackOverflow post “<a href="https://stackoverflow.com/questions/79632308" rel="nofollow ugc">https://stackoverflow.com/questions/79632308</a>”).</p>
<p dir="auto">Is there somewhere a working C# plugin (together with a working “DllExport”) that I can use as a starting point?</p>
<p dir="auto">Thanks in advance<br />
Dominique</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/26904/how-to-create-a-c-plugin</link><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Apr 2026 16:11:00 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/26904.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 26 May 2025 14:15:58 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to create a C# plugin? on Mon, 07 Jul 2025 16:40:29 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></p>
<p dir="auto">I haven’t checked the Scintilla source code, but I’d be surprised if the code didn’t just ignore the alpha value.<br />
A quick test seems to confirm this.</p>
<p dir="auto"><img src="/assets/uploads/files/1751906378512-81a75ca8-8b44-4ca7-90cf-a0e31b288f38-d5638942-d3bc-41b4-83bb-90b7c809d881.png" alt="81a75ca8-8b44-4ca7-90cf-a0e31b288f38-{D5638942-D3BC-41B4-83BB-90B7C809D881}.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.notepad-plus-plus.org/post/102420</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/102420</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Mon, 07 Jul 2025 16:40:29 GMT</pubDate></item><item><title><![CDATA[Reply to How to create a C# plugin? on Mon, 07 Jul 2025 16:37:03 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14479">@Ekopalypse</a> ,</p>
<p dir="auto">The difference in the hex values in your code compared to those that were in <a href="https://community.notepad-plus-plus.org/post/102410">the registry values</a> that <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/30229">@scampsd</a> shared might be a hint: those registry values are showing 4-byte RGBA values (with the highest byte, the alpha, always being 0xFF (255)).  I wonder if <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/30229">@scampsd</a> was assuming that passing in an RGBA into the SCI_INDICSETFORE message would automatically set alpha value.  (I just noticed the extra byte in the registry values after seeing your post with the 3byte RGB so emphasized in the screenshot.)</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/30229">@scampsd</a>,</p>
<p dir="auto"><a href="https://scintilla.org/ScintillaDoc.html#SCI_INDICSETFORE" rel="nofollow ugc">SCI_INDICSETFORE</a> accept RGB colors, not RGBA.  As is described for the <a href="https://scintilla.org/ScintillaDoc.html#colour" rel="nofollow ugc"><code>colour</code> vs <code>colouralpha</code> types listed in the intro of Scintilla docs</a>, any message (including SCI_INDICSETFORE) that is expecting a <code>colour</code> argument need RGB, <em>not</em> RGBA.  The only messages that accept RGBA are ones that are listed with <code>colouralpha</code>.</p>
<p dir="auto">So if you have grabbed a four-byte RGBA out of the registry for your foreground color, you need to split it, using psuedo-code like:</p>
<pre><code>rgba = read_from_registry(...)      # example: 0xffff8000
rgb = rgba &amp; 0x00FFFFFF             # example: 0x00ff8000
alpha_value = (rgba &gt;&gt; 24) &amp; 0xFF   # example: 0xff
SCI_INDICSETFORE(indicatorIndex, rgb)
SCI_INDICSETALPHA(indicatorIndex, alpha_value)
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/102419</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/102419</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Mon, 07 Jul 2025 16:37:03 GMT</pubDate></item><item><title><![CDATA[Reply to How to create a C# plugin? on Tue, 08 Jul 2025 12:23:37 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/30229">@scampsd</a>, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/3841">@peterjones</a>, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/26710">@mark-olson</a>, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14479">@ekopalypse</a>, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/27184">@coises</a>, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/7377">@alan-kilborn</a> and <strong>All</strong>,</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/30229">@scampsd</a>, the post, below, is a <em>small</em> part of my <strong><code>5</code></strong> <strong>successive</strong> posts about <strong>colors</strong> and the Notepad++ <strong>management</strong> of colors in <strong>styles</strong>, written in <strong><code>October 2019</code></strong>. Refer to :</p>
<p dir="auto"><a href="https://community.notepad-plus-plus.org/post/47895">https://community.notepad-plus-plus.org/post/47895</a></p>
<p dir="auto">or</p>
<p dir="auto"><a href="https://community.notepad-plus-plus.org/topic/18157/how-to-set-find-background-colour/24">https://community.notepad-plus-plus.org/topic/18157/how-to-set-find-background-colour/24</a></p>
<p dir="auto">I do hope, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/30229">@scampsd</a>, that you’ll find some <strong>useful</strong> information in this post and in my <strong>older</strong> posts about this topic, too !</p>
<hr />
<p dir="auto">Here is a very simple <strong>algorithm</strong> for the calculus of the <strong><code>RGB</code></strong> values of the color <strong><code>Cr</code></strong>, resulting of the mixing of a <strong>new</strong> color <strong><code>Cn</code></strong> with the <strong>current</strong> color <strong><code>Cc</code></strong> :</p>
<pre><code class="language-diff">
#---------------------
# Blend of TWO colors
#---------------------


#-----------------------------------------------------------------------------------------------------------------------------
#
#    RESULTING color Cr, from the blend of TWO colors, Cn and Cc, with an OPACITY factor alpha
#
#
#      IMPORTANT : This calculus can be used, EITHER, for the BLEND of :
#
#          - the NEW color, Cn, with the current FOREGROUND color Cc ( a TEXT )
#
#          - the NEW color, Cn, with the current BACKGROUND color Cc
#
#-----------------------------------------------------------------------------------------------------------------------------
#
#    Given a CURRENT color Cc with OPACITY factor = 1 and a NEW color Cn, ADDED, with an OPACITY factor alpha,
#
#        in the [ 0 - 1 ] interval, and the RESULTING color Cr, with an OPACITY factor = 1 :
#
#
#      We apply the general formula :    Cr = alpha * Cn + ( 1 - alpha ) * Cc
#
#          which can be rewritten   :    Cr = Cc + alpha * ( Cn - Cc )
#
#
#    If alpha =  1   then the RESULTING color Cr is the NEW   color Cn ( =&gt; The NEW color Cn is totally OPAQUE )
#
#    If alpha = .5   then the RESULTING color Cr is the PERFECT mixing of the TWO colors Cn and Cc
#
#    If alpha =  0   then the RESULTING color Cr is the CURRENT color Cc ( =&gt; The NEW color Cn is totally TRANSPARENT )
#
#-----------------------------------------------------------------------------------------------------------------------------


# --- Assumptions on opacity component alpha of the NEW color Cn -------------------------------------------------------------

#    alpha in interval [ 0 - 255 ]

# --- Normalization to interval [ 0 - 1 ] ------------------------------------------------------------------------------------

    alpha = alpha / 255

# --- Assumptions on Red, Green and Blue components of the CURRENT color Cc --------------------------------------------------

#    Rc in interval [ 0 - 255 ]    Gc in interval [ 0 - 255 ]    Bc in interval [ 0 - 255 ]

# --- Assumptions on Red, Green and Blue components of the NEW color Cn ------------------------------------------------------

#    Rn in interval [ 0 - 255 ]    Gn in interval [ 0 - 255 ]    Bn in interval [ 0 - 255 ]

# --- Calculus of Red, Green and Blue components of the RESULTING color Cr ---------------------------------------------------

    Rr = Rc + alpha * ( Rn - Rc )    Gr = Gc + alpha * ( Gn - Gc )    Br = Bc + alpha * ( Bn - Bc )

# --- Results : Red [ 0 - 255 ] , Green [ 0 - 255 ] and Blue [ 0 - 255 ] components of the RESULTING color -------------------

    PRINT Rr ; Gr ; Br

# ----------------------------------------------------------------------------------------------------------------------------
</code></pre>
<hr />
<p dir="auto">At last, if we apply the above <strong>equations</strong> to Notepad++, we can explain most of the <strong>resulting</strong> colors, due to the different user, N++ or plugins <strong>highlightings</strong> ;-))</p>
<p dir="auto">From tests, I noticed that <strong>all</strong> N++ background <strong>highlighting</strong> seem to use the value <strong>alpha</strong> = <strong><code>100/255</code></strong> ≈ <strong><code>0,3922</code></strong></p>
<p dir="auto">You’ll find some examples, below. Note that :</p>
<ul>
<li>
<p dir="auto"><strong>All</strong> the colors are described with the <strong><code>RGBA</code></strong> color space : <strong><code>(Red, Green, Blue, Alpha)</code></strong></p>
</li>
<li>
<p dir="auto">I assume the <strong>default</strong> N++ theme is used ( <strong><code>stylers.xml</code></strong> ). This implies that current <strong>text</strong> color is <strong>Black</strong> <strong><code>(0,0,0,1)</code></strong> and current <strong>background</strong> color is <strong>White</strong> <strong><code>(255,255,255,1)</code></strong></p>
</li>
<li>
<p dir="auto">I also assume that the option <strong><code>Settings &gt; Preferences... &gt; Editing &gt; Enable smooth font</code></strong> is <strong>unticked</strong></p>
</li>
<li>
<p dir="auto">The <strong>opaque</strong> current line and current selection styles are the <strong>default</strong> ones. So, <strong><code>RGBA</code></strong> value of <strong>current line</strong> Bg and <strong>current selection</strong> Bg are, respectively, <strong><code>(232,232,255,1)</code></strong> and <strong><code>(192,192,192,1)</code></strong></p>
</li>
</ul>
<pre><code class="language-diff">0,255,0,0.392   ( Smart Highlighting )         +  255,255,255,1 ( White Bg )              =&gt;  Resulting color = 155,255,155,1
0,255,0,0.392   ( Smart Highlighting )         +  232,232,255,1 ( Current line Bg )       =&gt;  Resulting color = 141,241,155,1
0,255,0,0.392   ( Smart Highlighting )         +  192,192,192,1 ( Current Selection Bg )  =&gt;  Resulting color = 117,217,117,1

255,0,0,0.392   ( Find Mark Style )            +  255,255,255,1 ( White Bg )              =&gt;  Resulting color = 255,155,155,1
255,0,0,0.392   ( Find Mark Style )            +  232,232,255,1 ( Current line Bg )       =&gt;  Resulting color = 241,141,155,1
255,0,0,0.392   ( Find Mark Style )            +  192,192,192,1 ( Current Selection Bg )  =&gt;  Resulting color = 217,117,117,1

255,128,0,0.392 ( Mark Style 2 )               +  255,255,255,1 ( White Bg )              =&gt;  Resulting color = 255,205,155,1
255,128,0,0.392 ( Mark Style 2 )               +  232,232,255,1 ( Current line Bg )       =&gt;  Resulting color = 241,191,155,1
255,128,0,0.392 ( Mark Style 2 )               +  192,192,192,1 ( Current Selection Bg )  =&gt;  Resulting color = 217,167,117,1


128,0,255,0.392 ( Mark Style 4 )               +  255,255,255,1 ( White Bg )              =&gt;  Resulting color = 205,155,255,1
128,0,255,0.392 ( Mark Style 4 )               +  232,232,255,1 ( Current line Bg )       =&gt;  Resulting color = 191,141,255,1
128,0,255,0.392 ( Mark Style 4 )               +  192,192,192,1 ( Current Selection Bg )  =&gt;  Resulting color = 167,117,217,1

0,128,255,0.392 ( Incremental Highlight All )  +  255,255,255,1 ( White Bg )              =&gt;  Resulting color = 155,205,255,1
0,128,255,0.392 ( Incremental Highlight All )  +  232,232,255,1 ( Current line Bg )       =&gt;  Resulting color = 141,191,255,1
0,128,255,0.392 ( Incremental Highlight All )  +  192,192,192,1 ( Current Selection Bg )  =&gt;  Resulting color = 117,167,217,1

0,128,255,0.392 ( Tag match highlighting )     +  255,255,255,1 ( White Bg )              =&gt;  Resulting color = 205,155,255,1
0,128,255,0.392 ( Tag match highlighting )     +  232,232,255,1 ( Current line Bg )       =&gt;  Resulting color = 191,141,255,1
0,128,255,0.392 ( Tag match highlighting )     +  192,192,192,1 ( Current Selection Bg )  =&gt;  Resulting color = 167,117,217,1

255,255,0,0.392 ( Tag Attribute )              +  232,232,255,1 ( Current line Bg )       =&gt;  Resulting color = 241,241,155,1
255,255,0,0.392 ( Tag Attribute )              +  192,192,192,1 ( Current Selection Bg )  =&gt;  Resulting color = 217,217,117,1

</code></pre>
<p dir="auto">If we apply, <strong>both</strong>, <strong><code>Mark Style 2</code></strong> and <strong><code>Mark Style 4</code></strong> on <strong>Current</strong> Background, this operation is <strong>equivalent</strong> to :</p>
<ul>
<li>
<p dir="auto">Firstly, apply the <strong><code>Mark Style 4</code></strong> on <strong>Current</strong> Background</p>
</li>
<li>
<p dir="auto">Secondly, apply the <strong><code>Mark style 2</code></strong> on the <strong>resulting</strong> color ( <strong><code>Mark Style 4</code></strong> + <strong>Current</strong> Background )</p>
</li>
</ul>
<p dir="auto">Note that the <strong>order</strong> is important : the style, of <strong>higher</strong> value, must be processed <strong>first</strong>. So, <strong><code>Style 4</code></strong> then <strong><code>Style 2</code></strong> !</p>
<p dir="auto">Hence :</p>
<pre><code class="language-diff">255,128,0,0.392 ( Mark Style 2 )  +  205,155,255,1 ( Mark Style 4  +  White Bg             )  =&gt;  Resulting color = 225,144,155,1
255,128,0,0.392 ( Mark Style 2 )  +  191,141,255,1 ( Mark Style 4  +  Current Line Bg      )  =&gt;  Resulting color = 216,136,155,1
255,128,0,0.392 ( Mark Style 2 )  +  167,117,217,1 ( Mark Style 4  +  Current Selection Bg )  =&gt;  Resulting color = 202,121,132,1
</code></pre>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/102418</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/102418</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Tue, 08 Jul 2025 12:23:37 GMT</pubDate></item><item><title><![CDATA[Reply to How to create a C# plugin? on Mon, 07 Jul 2025 16:10:57 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/30229">@scampsd</a> said in <a href="/post/102412">How to create a C# plugin?</a>:</p>
<blockquote>
<p dir="auto">I honestly believe: either something is wrong with the indicator technology</p>
</blockquote>
<p dir="auto">:-D I honestly think it’s more likely to be your code. :-D</p>
<p dir="auto"><img src="/assets/uploads/files/1751904508155-3a86925b-3adb-4922-a758-baef7efacc44-7a4904b8-ff7a-4d1e-b3d8-c98b14a86ea7.png" alt="3a86925b-3adb-4922-a758-baef7efacc44-{7A4904B8-FF7A-4D1E-B3D8-C98B14A86EA7}.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">just a quick demo - not production ready !!</p>
<pre><code>fn (e Editor) set_text() {
	text := c"
Trace_Background      REG_DWORD    0xff0000
Debug_Background      REG_DWORD    0x00ff00
Info_Background       REG_DWORD    0x0000ff
Fatal_Background      REG_DWORD    0xff00ff
Error_Background      REG_DWORD    0xff8000
Warning_Background    REG_DWORD    0x0000ff
"
	e.call(sci_settext, 0, isize(text))

}

fn (e Editor) init_indicator() {
	for i in 15..21 {
		e.call(sci_indicsetstyle, usize(i), 7)
		match i {
			15 { e.call(sci_indicsetfore, usize(i), 0xff0000) }
			16 { e.call(sci_indicsetfore, usize(i), 0x00ff00) }
			17 { e.call(sci_indicsetfore, usize(i), 0x0000ff) }
			18 { e.call(sci_indicsetfore, usize(i), 0xff00ff) }
			19 { e.call(sci_indicsetfore, usize(i), 0xff8000) }
			20 { e.call(sci_indicsetfore, usize(i), 0x0000ff) }
			else {}
		}
		e.call(sci_indicsetalpha, usize(i), 55)
		e.call(sci_indicsetoutlinealpha, usize(i), 255)
	}
}

fn (e Editor) highlight_line(line int, indicator int) {
	start_pos := e.call(sci_positionfromline, usize(line), 0)
	length := e.call(sci_linelength, usize(line), 0)
	e.call(sci_setindicatorcurrent, usize(indicator), 0)
	e.call(sci_indicatorfillrange, usize(start_pos), isize(length))
}

pub fn (e Editor) test() {
	e.init_indicator()
	e.set_text()
	line_count := e.call(sci_getlinecount, 0, 0)
	for i:=0; i&lt;line_count; i++ {
		length := e.call(sci_linelength, usize(i), 0)
		buffer := vcalloc(length+1)
		e.call(sci_getline, usize(i), isize(buffer))
		line_content := unsafe { cstring_to_vstring(buffer) }
		if line_content.starts_with('Trace') {
			e.highlight_line(i, 15)
		} else if line_content.starts_with('Debug') {
			e.highlight_line(i, 16)
		} else if line_content.starts_with('Info') {
			e.highlight_line(i, 17)
		} else if line_content.starts_with('Fatal') {
			e.highlight_line(i, 18)
		} else if line_content.starts_with('Error') {
			e.highlight_line(i, 19)
		} else if line_content.starts_with('Warning') {
			e.highlight_line(i, 20)
		} else {
			continue
		}
	}
}
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/102417</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/102417</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Mon, 07 Jul 2025 16:10:57 GMT</pubDate></item><item><title><![CDATA[Reply to How to create a C# plugin? on Mon, 07 Jul 2025 15:07:26 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/30229">@scampsd</a> said in <a href="/post/102412">How to create a C# plugin?</a>:</p>
<blockquote>
<p dir="auto">apparently the first “Trace” line is red and the lines between the second and third “Trace” line are some kind of “dimmed” red:</p>
</blockquote>
<p dir="auto">The first line is the line that has the caret.  Notepad++ (and all scintilla-based editors) can highlight the “active line” differently than the others, and this <em>does</em> affect background colors of indicators or stylers.</p>
<blockquote>
<p dir="auto">something is wrong with the indicator technology</p>
</blockquote>
<p dir="auto">The “indicator” colors are applied with transparency.  When Notepad++ uses indicators (for Smart Highlighting, Find Mark Style, and the style-a-token coloring – which use indicators under the hood), it seems to apply a transparency of about 60% (as described <a href="https://npp-user-manual.org/docs/preferences/#:~:text=Smart%20Highlighting%20%5Bbackground%20only%5D" rel="nofollow ugc">here</a> ): with Notepad++'s usage, if you have a highlight of green RGB=[0,255,0], with a white RGB=[255,255,255] background, the actual color will be RGB=[155,255,155]</p>
<p dir="auto">Ah, here it is: in Scintilla, there is the <a href="https://scintilla.org/ScintillaDoc.html#SCI_INDICSETALPHA" rel="nofollow ugc">SCI_INDICSETALPHA/SCI_INDICGETALPHA</a> to set/get the alpha (transparency) value for the given indicator.  [The alpha value can range from 0 (completely transparent) to 255 (no transparency)].</p>
<p dir="auto">If you don’t like the amount of transparency you are currently seeing, I’d try getting that value to see what the “default” is, and then setting it to something less transparent, to see if it’s more to your liking.</p>
<p dir="auto">But understand: Scintilla itself, or Notpead++'s settings for other Scintilla colors, may be <em>also</em> applying colors with some transparency that will combine taking higher priority above your non-transparent indicators, and you might not be able to get around that.  I think this might actually be the case, because from <a href="https://github.com/notepad-plus-plus/notepad-plus-plus/blob/03063ebf4b2861ae15382e8eba8e8c0d87c53614/PowerEditor/src/ScintillaComponent/ScintillaEditView.cpp#L295-L304" rel="nofollow ugc">what I can find</a>, Notepad++ is setting alpha to <s>255 [no transparency]</s> for the indicators, but it’s effectively getting 60% transparency, so there is some other color merging going on under the hood, as far as I can tell.</p>
<hr />
<p dir="auto"><em>update 1</em>: no, Notepad++ is setting the value to 100 – I was reading that as “100%”, but it’s actually 100 out of a possible 255 – which is 39% of 255: since the scale is backward (with 0 being fully transparent and 255 being non-transparent, that means 61%, which is definitely “approximately 60%”).  When I ran <code>for i in range(44): console.write("indic#{:02d} =&gt; {}\n".format(i, editor.indicGetAlpha(i)))</code> in PythonScript, it lists most indicators at about value=30/255 (which is mostly-transparent, about 90%).</p>
<pre><code>indic#00 =&gt; 30
indic#01 =&gt; 30
indic#02 =&gt; 30
indic#03 =&gt; 30
indic#04 =&gt; 30
indic#05 =&gt; 30
indic#06 =&gt; 30
indic#07 =&gt; 30
indic#08 =&gt; 70
indic#09 =&gt; 30
indic#10 =&gt; 30
indic#11 =&gt; 30
indic#12 =&gt; 30
indic#13 =&gt; 55
indic#14 =&gt; 30
indic#15 =&gt; 30
indic#16 =&gt; 30
indic#17 =&gt; 30
indic#18 =&gt; 30
indic#19 =&gt; 30
indic#20 =&gt; 30
indic#21 =&gt; 100
indic#22 =&gt; 100
indic#23 =&gt; 100
indic#24 =&gt; 100
indic#25 =&gt; 100
indic#26 =&gt; 100
indic#27 =&gt; 100
indic#28 =&gt; 100
indic#29 =&gt; 100
indic#30 =&gt; 30
indic#31 =&gt; 100
indic#32 =&gt; 30
indic#33 =&gt; 30
indic#34 =&gt; 30
indic#35 =&gt; 30
indic#36 =&gt; 30
indic#37 =&gt; 30
indic#38 =&gt; 30
indic#39 =&gt; 30
indic#40 =&gt; 30
indic#41 =&gt; 30
indic#42 =&gt; 30
indic#43 =&gt; 30
</code></pre>
<p dir="auto"><em>(Those values are just what mine happen to be at: I’ve got a lot of plugins and other such things, so other than recognizing Notepad++'s value of “100” for its indicators, I don’t know for sure what’s setting #8 to 70 or #13 to 55)</em></p>
<hr />
<p dir="auto"><em>update 2</em>:<br />
Default token#1 indicator (alpha=30):<br />
<img src="/assets/uploads/files/1751900778325-afc823eb-a8de-47d7-bfc0-c7df32fdca24-image.png" alt="afc823eb-a8de-47d7-bfc0-c7df32fdca24-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Change to alpha=10:<br />
<img src="/assets/uploads/files/1751900802584-12b3f0f5-f7b1-4146-8335-178bdfa1a7dd-image.png" alt="12b3f0f5-f7b1-4146-8335-178bdfa1a7dd-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">And alpha=255:<br />
<img src="/assets/uploads/files/1751900819807-5eb1bc37-3b49-41fb-9922-128e7d434c67-image.png" alt="5eb1bc37-3b49-41fb-9922-128e7d434c67-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">In each of those images, the first line is the “active line” and the second is a non-active line, so you can see how active-line affects things.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/102415</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/102415</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Mon, 07 Jul 2025 15:07:26 GMT</pubDate></item><item><title><![CDATA[Reply to How to create a C# plugin? on Mon, 07 Jul 2025 13:24:45 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14479">@Ekopalypse</a> You’re right: I’ve disabled all configurations, except for the “Trace” one (I used the red colour for that one), and apparently the first “Trace” line is red and the lines between the second and third “Trace” line are some kind of “dimmed” red:</p>
<p dir="auto"><img src="/assets/uploads/files/1751890600680-29553552-46cf-4531-81b8-e2b41f7c5507-image.png" alt="29553552-46cf-4531-81b8-e2b41f7c5507-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">I honestly believe: either something is wrong with the indicator technology, either I’m using the indicator technology in a way it’s not supposed to (I already find it very strange I need to calculate positions of individual characters in order to highlight an entire line).</p>
<p dir="auto">Does anybody have an idea?<br />
Thanks</p>
]]></description><link>https://community.notepad-plus-plus.org/post/102412</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/102412</guid><dc:creator><![CDATA[scampsd]]></dc:creator><pubDate>Mon, 07 Jul 2025 13:24:45 GMT</pubDate></item><item><title><![CDATA[Reply to How to create a C# plugin? on Mon, 07 Jul 2025 10:04:49 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/30229">@scampsd</a> said in <a href="/post/102410">How to create a C# plugin?</a>:</p>
<blockquote>
<p dir="auto">As you see, the colouring per line seems to be fine now.</p>
</blockquote>
<p dir="auto">I don’t think this is ok because, for example, the trace lines have different colors, which makes me suspect that you are somehow overlaying different colors.<br />
Can you define just one color and see if that makes a difference?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/102411</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/102411</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Mon, 07 Jul 2025 10:04:49 GMT</pubDate></item><item><title><![CDATA[Reply to How to create a C# plugin? on Mon, 07 Jul 2025 09:20:26 GMT]]></title><description><![CDATA[<p dir="auto">I’ve modified the <code>EndOfLine</code> character from <code>"\r\n"</code> into <code>"\n"</code> and it’s already a lot better:</p>
<pre><code>public const string EndOfLine = "\n";
</code></pre>
<p dir="auto">Result:</p>
<p dir="auto"><img src="/assets/uploads/files/1751878886455-4140c264-0141-4340-9e15-0ff11e3e7606-image.png" alt="4140c264-0141-4340-9e15-0ff11e3e7606-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">As you see, the colouring per line seems to be fine now.<br />
So let’s head to the following subject: the colouring is ugly, as you can see from the following form:</p>
<p dir="auto"><img src="/assets/uploads/files/1751879347226-e40f064c-7410-476f-af15-9b741b5655b2-image.png" alt="e40f064c-7410-476f-af15-9b741b5655b2-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">The “Trace” colour (being red) is not really red in the Notepad++ editor.<br />
The “Debug” colour (being green) is not really green in the Notepad++ editor.<br />
…</p>
<p dir="auto">Is there a way to make sure that the colours, as defined in the configuration form (and saved into registry) are well shown in the Notepad++ editor?</p>
<p dir="auto">In case of doubt, hereby the values in the registry:</p>
<pre><code>reg query "HKEY_CURRENT_USER\SOFTWARE\Notepad++Plugins\NLog_Integration" /S

HKEY_CURRENT_USER\SOFTWARE\Notepad++Plugins\NLog_Integration
    Trace_Background      REG_DWORD    0xffff0000
    Debug_Background      REG_DWORD    0xff00ff00
    Info_Background       REG_DWORD    0xff0000ff
    Fatal_Background      REG_DWORD    0xffff00ff
    Error_Background      REG_DWORD    0xffff8000
    Warning_Background    REG_DWORD    0xff0000ff
</code></pre>
<p dir="auto">For your information: it’s not related to the style of the indicators, as they all have the same style (<code>FULLBOX</code>), as you can see:</p>
<pre><code>Npp.editor.IndicSetStyle(..., IndicatorStyle.FULLBOX);
</code></pre>
<p dir="auto">Is there any “indicator configuration” which means something like “Show the colour of an indicator exactly as meant”? (I know it sounds silly, but you get the idea 😀)</p>
<p dir="auto">Thanks in advance</p>
]]></description><link>https://community.notepad-plus-plus.org/post/102410</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/102410</guid><dc:creator><![CDATA[scampsd]]></dc:creator><pubDate>Mon, 07 Jul 2025 09:20:26 GMT</pubDate></item><item><title><![CDATA[Reply to How to create a C# plugin? on Mon, 07 Jul 2025 07:56:15 GMT]]></title><description><![CDATA[<p dir="auto">Good morning, guys.<br />
Due to circumstances (I’m on holiday for supporting my sick mother), I don’t always have time to work on the plugin, hence my absence for some weeks.</p>
<p dir="auto">I have decided to save the corresponding configurations in the registry anyway, but I’m doing this on user level (HKCU instead of HKLM). As a result, I don’t need administrator privileges for running the plugin. That part is working fine now.</p>
<p dir="auto">I’m now back to the colouring, and there some things are going wrong, I believe it’s due to the 2-character end-of-line, shifting the colours in a wrong way.</p>
<p dir="auto">Let me show you the code I currently have:</p>
<pre><code>#region " Key texts "
public static string Txt_Trace     = "| Trace |";
public static string Txt_Debug     = "| Debug |";
...

// define EndOfLine character
public const string EndOfLine = "\r\n";

// Create a testfile
Npp.notepad.FileNew();
string text = $"{Txt_Trace}   : Test 00\r\n" +
              $"{Txt_Debug}   : Test 01\r\n" +
              $"{Txt_Info}    : Test 02\r\n"  +
              $"{Txt_Fatal}   : Test 03\r\n" +
              $"{Txt_Error}   : Test 04\r\n" +
              $"{Txt_Warning} : Test 05\r\n" + 
              ...

// Perform the colouring
int iAmountOfLines = Npp.editor.GetLineCount();
for (int i = 0 ; i &lt; iAmountOfLines; i++)
{
    string strCurrentLine = Npp.editor.GetLine(i);
    int iStartPosition, iLength;
    iStartPosition = Npp.editor.GetLineEndPosition(i) + EndOfLine.Length - strCurrentLine.Length;
    if (i != 0) iStartPosition++; // in order to replace 0-18,18-36,36-54 by 0-18,19-37,38-56
    iLength = Npp.editor.GetLineEndPosition(i) + EndOfLine.Length;

    if (strCurrentLine.IndexOf(Txt_Trace) != -1)   Npp.editor.SetIndicatorCurrent(0); // Trace
    if (strCurrentLine.IndexOf(Txt_Debug) != -1)   Npp.editor.SetIndicatorCurrent(1); // Debug
    if (strCurrentLine.IndexOf(Txt_Info) != -1)    Npp.editor.SetIndicatorCurrent(2); // Info
    if (strCurrentLine.IndexOf(Txt_Fatal) != -1)   Npp.editor.SetIndicatorCurrent(3); // Fatal
    if (strCurrentLine.IndexOf(Txt_Error) != -1)   Npp.editor.SetIndicatorCurrent(4); // Error
    if (strCurrentLine.IndexOf(Txt_Warning) != -1) Npp.editor.SetIndicatorCurrent(5); // Warning
    Npp.editor.IndicatorFillRange(iStartPosition, iLength);
}
</code></pre>
<p dir="auto">Something is terribly wrong, as you can see in the following result:<br />
<img src="/assets/uploads/files/1751874801722-0cb08e55-fb52-4216-bb86-6f3148947b87-image.png" alt="0cb08e55-fb52-4216-bb86-6f3148947b87-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">I’ve already been experimenting a lot, but I never get it exactly right.</p>
<p dir="auto">Does anybody have an idea?<br />
Thanks in advance</p>
]]></description><link>https://community.notepad-plus-plus.org/post/102406</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/102406</guid><dc:creator><![CDATA[scampsd]]></dc:creator><pubDate>Mon, 07 Jul 2025 07:56:15 GMT</pubDate></item><item><title><![CDATA[Reply to How to create a C# plugin? on Thu, 05 Jun 2025 09:40:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/30229">@scampsd</a></p>
<p dir="auto">Although the registry is actually the Windows standard, I would personally avoid it and rather use the plugin config directory. Can be determined via <a href="https://npp-user-manual.org/docs/plugin-communication/#2070nppm_getpluginsconfigdir" rel="nofollow ugc">NPPM_GETPLUGINSCONFIGDIR</a>.<br />
However, I would create a subdirectory with the plugin name and add a json, xml, toml … file there.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/101950</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/101950</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Thu, 05 Jun 2025 09:40:29 GMT</pubDate></item><item><title><![CDATA[Reply to How to create a C# plugin? on Thu, 05 Jun 2025 09:06:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14479">@Ekopalypse</a> : Let me start by thanking all of you for the wonderful support I’m getting from you guys.</p>
<p dir="auto">At this moment I’m at the stage that I’m having the following pieces of source code:</p>
<pre><code>int iAmountOfLines = Npp.editor.GetLineCount();
for (int i = 0 ; i &lt; iAmountOfLines; i++)
{
    string strCurrentLine = Npp.editor.GetLine(i);
    if (strCurrentLine.IndexOf(Txt_Trace) != -1)
    {
        Npp.editor.SetIndicatorCurrent(0); // Trace
        Npp.editor.IndicatorFillRange(Npp.editor.GetLineEndPosition(i) - strCurrentLine.Length, Npp.editor.GetLineEndPosition(i));
    }
</code></pre>
<p dir="auto">The “if”-clause is being repeated for all log levels, and it is currently giving the following output (not correct, but very promising 😀):<br />
<img src="/assets/uploads/files/1749113639937-7bb5e778-de0d-4fb5-b4eb-d8a5b1574d2d-image.png" alt="7bb5e778-de0d-4fb5-b4eb-d8a5b1574d2d-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">When seeing that, you might wonder how I have configured the corresponding colours. Well, me too 😥. Let me show you what I mean: this is what I see when I open the corresponding configuration form:</p>
<p dir="auto"><img src="/assets/uploads/files/1749113907048-3de2b277-db29-4a8d-9f4a-00a70eb3d058-image.png" alt="3de2b277-db29-4a8d-9f4a-00a70eb3d058-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">“But Dominique, you didn’t configure your colours?”</p>
<p dir="auto">Well, I did, but I forgot two things:</p>
<ol>
<li>Using the already configured colours while re-opening the configuration form, I’ll take care of that.</li>
<li>Saving the already configured colours in registry, in order to avoid needing to re-configure the whole thing every time I perform a test.</li>
</ol>
<p dir="auto">About that last part, I have the simple question: “Where?”.</p>
<p dir="auto">For your information, this is what my registry looks like at “HKey_Local_Machine\SOFTWARE”:</p>
<p dir="auto"><img src="/assets/uploads/files/1749114210613-340add9b-e8ce-4f00-8c6e-5fb880ee01f2-image.png" alt="340add9b-e8ce-4f00-8c6e-5fb880ee01f2-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">You might notice two things:</p>
<ol>
<li>There is another tool (Mozilla), having its plugins configured around that place.</li>
<li>There are no Notepad++ plugins being configured around that place. (Although I have some Notepad++ plugins I’ve used before)</li>
</ol>
<p dir="auto">Can anybody confirm if I’m at the right spot for saving Notepad++ plugin configurations? If not, what’s a place which is better suited?</p>
<p dir="auto">Thanks in advance (again)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/101947</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/101947</guid><dc:creator><![CDATA[scampsd]]></dc:creator><pubDate>Thu, 05 Jun 2025 09:06:27 GMT</pubDate></item><item><title><![CDATA[Reply to How to create a C# plugin? on Thu, 05 Jun 2025 08:28:45 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/30229">@scampsd</a></p>
<p dir="auto">Another possibility would be to use the internal search engine of Npp and thus avoid the encoding problem.<br />
This means using SCI_SEARCHINTARGET with a corresponding regular expression in a loop and then SCI_GETTARGETSTART and SCI_GETTARGETEND to determine the positions. SCI_GETTARGETEND then becomes the next start position for SCI_SEARCHINTARGET …</p>
]]></description><link>https://community.notepad-plus-plus.org/post/101945</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/101945</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Thu, 05 Jun 2025 08:28:45 GMT</pubDate></item><item><title><![CDATA[Reply to How to create a C# plugin? on Wed, 04 Jun 2025 21:01:03 GMT]]></title><description><![CDATA[<p dir="auto">I said:</p>
<blockquote>
<p dir="auto">I think you need to spend some time getting more familiar with the editor API, i.e., the Scintilla documentation (a portion of which was linked to earlier). It has everything you’ll need.</p>
</blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/3841">@PeterJones</a> said:</p>
<blockquote>
<p dir="auto">While that is good advice, for someone just getting started, it’s knowing where to look in that rather big document, or the right search terms, that is the difficulty.</p>
</blockquote>
<hr />
<p dir="auto">I said what I said because I was feeling like this topic was heading in the direction of potentially a lot of spoon-feeding.  Everyone should spend time with the documentation when they’re using something new, and ask detailed questions when those questions are really needed.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/101943</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/101943</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Wed, 04 Jun 2025 21:01:03 GMT</pubDate></item><item><title><![CDATA[Reply to How to create a C# plugin? on Wed, 04 Jun 2025 18:44:01 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/27184">@Coises</a> said in <a href="/post/101941">How to create a C# plugin?</a>:</p>
<blockquote>
<p dir="auto">I’m not sure how that translates to the C# functions you mentioned, but there are non-ASCII characters (128 of them, different ones for each code page) that can still be represented in ANSI mode.</p>
</blockquote>
<p dir="auto">See how my <a href="https://github.com/npp-dotnet/Npp.DotNet.Plugin/blob/cc00741e185d4fbd4e3dea12161b600ca97a6d7c/lib/Plugin/ScintillaGateway.cs#L5112" rel="nofollow ugc">.NET Core template</a> wraps all of Scintilla’s text manipulation APIs in a private method that takes account of the <em>document’s</em> encoding (which may be single-byte ASCII), converting to a properly encoded byte array before the window procedure call. (<em>Note: <code>CodePage</code> is the name of an <a href="https://npp-dotnet.github.io/Npp.DotNet.Plugin/api/Npp.DotNet.Plugin.IScintillaGateway.html#Npp_DotNet_Plugin_IScintillaGateway_CodePage" rel="nofollow ugc">interface property</a>, which .NET Framework apparently supports, since the class library is <a href="https://github.com/npp-dotnet/Npp.DotNet.Plugin/blob/cc00741e185d4fbd4e3dea12161b600ca97a6d7c/lib/Npp.DotNet.csproj#L22" rel="nofollow ugc">multi-targeted</a>.</em>)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/101942</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/101942</guid><dc:creator><![CDATA[rdipardo]]></dc:creator><pubDate>Wed, 04 Jun 2025 18:44:01 GMT</pubDate></item><item><title><![CDATA[Reply to How to create a C# plugin? on Wed, 04 Jun 2025 18:05:53 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/26710">@Mark-Olson</a> said in <a href="/post/101939">How to create a C# plugin?</a>:</p>
<blockquote>
<p dir="auto">Notepad++ uses UTF-8 to encode its buffers</p>
</blockquote>
<p dir="auto">I don’t know C# or the C# interface, so this might not be relevant there, but in general, Notepad++ may work with Scintilla using UTF-8 <em>or</em> “ANSI” — ANSI being the system default Windows ANSI code page. <a href="https://www.scintilla.org/ScintillaDoc.html#SCI_GETCODEPAGE" rel="nofollow ugc">SCI_GETCODEPAGE</a> tells you which it is; in Notepad++ it is always either CP_ACP or CP_UTF8. (<a href="https://learn.microsoft.com/en-us/windows/win32/api/stringapiset/nf-stringapiset-multibytetowidechar#parameters" rel="nofollow ugc">Defined, for example, here.</a>)</p>
<p dir="auto">I’m not sure how that translates to the C# functions you mentioned, but there are non-ASCII characters (128 of them, different ones for each code page) that can still be represented in ANSI mode. Like any ANSI character, they take up one position in Scintilla, not the number of positions the corresponding UTF-8 character would require.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/101941</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/101941</guid><dc:creator><![CDATA[Coises]]></dc:creator><pubDate>Wed, 04 Jun 2025 18:05:53 GMT</pubDate></item><item><title><![CDATA[Reply to How to create a C# plugin? on Wed, 04 Jun 2025 16:51:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/7377">@Alan-Kilborn</a> said in <a href="/post/101938">How to create a C# plugin?</a>:</p>
<blockquote>
<p dir="auto">I think you need to spend some time getting more familiar with the editor API, i.e., the Scintilla documentation (a portion of which was linked to earlier). It has everything you’ll need.</p>
</blockquote>
<p dir="auto">While that is good advice, for someone just getting started, it’s knowing where to look in that rather big document, or the right search terms, that is the difficulty.</p>
<p dir="auto">For example, I’m not sure it’s natural to me to look in the <a href="https://scintilla.org/ScintillaDoc.html#Information" rel="nofollow ugc">“Information” section</a> to find the commands that convert between position and line, and whether to search for <code>line start</code> or <code>start line</code> or <code>start of line</code> or <code>start of the line</code>.  (And of course, a search for <code>line</code> or <code>start</code> alone finds way too many to help narrow things down.)  (And yes, I did intentionally pick those examples to throw <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/30229">@scampsd</a> a bone to help narrow down the search range for solving the immediate problem.)</p>
<p dir="auto">Even as someone who has done a lot of interacting with Scintilla through the PythonScript interface, I can find it difficult to find the right command that I’m looking for, because I use the wrong term, or I don’t go to the right subsection to find the right group of commands to be able to find the one I’m looking for.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/101940</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/101940</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Wed, 04 Jun 2025 16:51:32 GMT</pubDate></item><item><title><![CDATA[Reply to How to create a C# plugin? on Wed, 04 Jun 2025 16:40:22 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/30229">@scampsd</a></p>
<blockquote>
<p dir="auto">I’m obviously capable to calculate the start and length</p>
</blockquote>
<p dir="auto">Be careful! Notepad++ uses UTF-8 to encode its buffers so you need to use <a href="https://github.com/molsonkiko/NppCSharpPluginPack/blob/15a504c998b16262dac1c4e83532bf8880e1cdbc/NppCSharpPluginPack/JSON_Tools/JsonParser.cs#L318" rel="nofollow ugc"><code>JsonParser.ExtraUTF8Bytes</code> and <code>JsonParser.ExtraUTF8BytesBetween</code></a> if you want to convert between indices in your C# strings and positions in the document.</p>
<p dir="auto">EDIT: this is only necessary if your plugin will be running on files that contain non-ASCII characters.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/101939</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/101939</guid><dc:creator><![CDATA[Mark Olson]]></dc:creator><pubDate>Wed, 04 Jun 2025 16:40:22 GMT</pubDate></item><item><title><![CDATA[Reply to How to create a C# plugin? on Wed, 04 Jun 2025 14:32:47 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/30229">@scampsd</a> said:</p>
<blockquote>
<p dir="auto">an easier way to work with lines of text in the editor.</p>
</blockquote>
<p dir="auto">I think you need to spend some time getting more familiar with the editor API, i.e., the Scintilla documentation (a portion of which was linked to earlier).  It has everything you’ll need.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/101938</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/101938</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Wed, 04 Jun 2025 14:32:47 GMT</pubDate></item><item><title><![CDATA[Reply to How to create a C# plugin? on Wed, 04 Jun 2025 14:25:50 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14479">@Ekopalypse</a> Thanks, I get that now.<br />
I’m succeeding colouring some pieces of text now but you might imagine the next question: the method <code>Npp.editor.IndicatorFillRange(int start, int length)</code> is, as you mentioned, depending on start integer and length integer, while I’m working with entire lines.</p>
<p dir="auto">I’m obviously capable to calculate the start and length, based on content of “| Trace |” or “| Debug |” and the newline characters (hardcoded <code>"\r\n"</code>), but I’m wondering if there’s not an easier way to work with lines of text in the editor.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/101937</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/101937</guid><dc:creator><![CDATA[scampsd]]></dc:creator><pubDate>Wed, 04 Jun 2025 14:25:50 GMT</pubDate></item><item><title><![CDATA[Reply to How to create a C# plugin? on Wed, 04 Jun 2025 14:19:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/30229">@scampsd</a><br />
So the purpose of <code>AllocateIndicators</code> is to tell Notepad++ that you want to use a certain number of indicators. Based on how many indicators you requested, Notepad++ tells you which ones you can use (that’s the <code>out int[]</code> parameter). These are reserved for you for the rest of the session.</p>
<p dir="auto">Once you have the indicators, you customize their appearance using methods like <code>IndicSetStyle</code> and <code>IndicSetFore</code>. You can do this once at startup; once you’ve customized the style it stays that way for the rest of the session.</p>
<p dir="auto">To style a given region of a document with an indicator, use <code>SetIndicatorCurrent</code> and <code>IndicatorFillRange</code>.</p>
<p dir="auto">To find all the regions of a document that are styled with a given indicator, use <code>IndicatorStart</code>, <code>IndicatorEnd</code>, and <code>IndicatorValueAt</code> as shown <a href="https://github.com/molsonkiko/JsonToolsNppPlugin/blob/9fdd4a151946e1eab756b7525d1e955d5adae72f/JsonToolsNppPlugin/Utils/SelectionManager.cs#L26" rel="nofollow ugc">in this example from JsonTools</a>.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/101934</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/101934</guid><dc:creator><![CDATA[Mark Olson]]></dc:creator><pubDate>Wed, 04 Jun 2025 14:19:46 GMT</pubDate></item><item><title><![CDATA[Reply to How to create a C# plugin? on Wed, 04 Jun 2025 12:27:33 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/30229">@scampsd</a> said in <a href="/post/101929">How to create a C# plugin?</a>:</p>
<blockquote>
<p dir="auto">Can anybody explain me why the mentioned indicators get linked to the 9th, the 10th</p>
</blockquote>
<p dir="auto">You have used the IDs as the starting position.</p>
<pre><code>SCI_INDICATORFILLRANGE(position start, position lengthFill)
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/101930</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/101930</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Wed, 04 Jun 2025 12:27:33 GMT</pubDate></item><item><title><![CDATA[Reply to How to create a C# plugin? on Wed, 04 Jun 2025 12:18:49 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/7377">@Alan-Kilborn</a> Sorry for the late reply: I don’t have the time to work on this matter every day.</p>
<p dir="auto">If I understand well, I seem to have the following choices:</p>
<ol>
<li>Indicators : this is something which might work, but the provided example is based on the method <code>Npp.notepad.AllocateIndicators(numberOfIndicators, out int[] indicators)</code>, which is not very clear yet.</li>
<li>Styles : if I understood correctly, the maximum number of styles (being 5) is not only a limitation for Notepad++ users, but also for Notepad++ plugin developers.</li>
<li>Markers : again another approach.</li>
</ol>
<p dir="auto">If you don’t mind, I’d like to proceed with the “Indicators” approach, but then I need to understand the <code>AllocateIndicators()</code> method, and it looks really not simple: the provided example launches that method and as a result, a list of indicators seems to be linked with some individual characters, present in the text.<br />
I have done the following modifications to the example:</p>
<pre><code>for (int ii = firstIndicator; ii &lt;= lastIndicator; ii++)
{
    Npp.editor.SetIndicatorCurrent(ii);
    Npp.editor.IndicSetFore(ii, new Colour(255, 0, 0)); // Colour RED
    Npp.editor.IndicSetStyle(ii, IndicatorStyle.FULLBOX); // Use full rectangle
    Npp.editor.IndicatorFillRange(ii, 5); // Not one but five characters long
}
</code></pre>
<p dir="auto">The result is the following:<br />
<img src="/assets/uploads/files/1749039216307-445a9474-8cc9-4a70-b8ea-666a8112e6cc-image.png" alt="445a9474-8cc9-4a70-b8ea-666a8112e6cc-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Can anybody explain me <strong>why</strong> the mentioned indicators get linked to the 9th, the 10th, … up to the 14th character? How can I change that and link those indicators to other characters, words, lines, …?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/101929</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/101929</guid><dc:creator><![CDATA[scampsd]]></dc:creator><pubDate>Wed, 04 Jun 2025 12:18:49 GMT</pubDate></item><item><title><![CDATA[Reply to How to create a C# plugin? on Wed, 04 Jun 2025 11:53:12 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> said:</p>
<blockquote>
<p dir="auto">The first paragraph of the Marker API  docs say, “Markers appear in the selection margin to the left of the text.”</p>
</blockquote>
<p dir="auto">It says that, but it is not 100% true.<br />
If one uses SC_MARK_BACKGROUND or SC_MARK_UNDERLINE, the result is <em>not</em> in the margin, but rather in the text itself (as the graphical image that shows the examples–above, in Peter’s most-recent post–implies).</p>
<p dir="auto">Entire-line coloring seems to be what <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/30229">@scampsd</a> is trying to achieve, so perhaps using marker(s) with SC_MARK_BACKGROUND will be useful.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/101928</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/101928</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Wed, 04 Jun 2025 11:53:12 GMT</pubDate></item><item><title><![CDATA[Reply to How to create a C# plugin? on Wed, 04 Jun 2025 10:50:47 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/26710">@Mark-Olson</a> said in <a href="/post/101920">How to create a C# plugin?</a>:</p>
<blockquote>
<p dir="auto">the Marker API</p>
</blockquote>
<p dir="auto">and it has a really nice feature, it provides calls to jump to <a href="https://scintilla.org/ScintillaDoc.html#SCI_MARKERNEXT" rel="nofollow ugc">next or previous</a> marks.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/101926</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/101926</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Wed, 04 Jun 2025 10:50:47 GMT</pubDate></item></channel></rss>