<?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[Need help with disabling the autocomplete and the &quot;smart hightlighting&quot;]]></title><description><![CDATA[<p dir="auto">Is there a way to disable the autocomplete and the “smart hightlighting” features from within a plugin?  Preferably I want this only to affect certain tabs.</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/11967/need-help-with-disabling-the-autocomplete-and-the-smart-hightlighting</link><generator>RSS for Node</generator><lastBuildDate>Wed, 17 Jun 2026 09:24:20 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/11967.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 15 Jun 2016 06:32:09 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Need help with disabling the autocomplete and the &quot;smart hightlighting&quot; on Mon, 20 Jun 2016 23:01:14 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kasper-graversen" aria-label="Profile: Kasper-Graversen">@<bdi>Kasper-Graversen</bdi></a></p>
<p dir="auto">Ahh, now I understand. Thx for clarification.</p>
<p dir="auto">Cheers<br />
Claudia</p>
]]></description><link>https://community.notepad-plus-plus.org/post/16494</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/16494</guid><dc:creator><![CDATA[Claudia Frank]]></dc:creator><pubDate>Mon, 20 Jun 2016 23:01:14 GMT</pubDate></item><item><title><![CDATA[Reply to Need help with disabling the autocomplete and the &quot;smart hightlighting&quot; on Mon, 20 Jun 2016 20:47:20 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/claudia-frank" aria-label="Profile: Claudia-Frank">@<bdi>Claudia-Frank</bdi></a>  yes that’s the code. but notice my caching of the selection “computation”</p>
<pre><code> if (currentPosition != lastPositionWhenUiUpdate)
</code></pre>
<p dir="auto">if I select the first word and press PASTE and pasting another word of the same length, I need to select the new word. the currentposition is unchanged, so my if statement would not re-select.</p>
<p dir="auto">the latest version of the code has become slightly simplified</p>
<pre><code>		if (isPluginActive)
		{
			nppResource.ClearIndicator();

			if (notification.Header.Code == (ulong) SciMsg.SCN_UPDATEUI)
			{
				var scintillaGateway = new ScintillaGateway(PluginBase.GetCurrentScintilla());
				var currentPosition = scintillaGateway.GetCurrentPos();
				if (currentPosition != lastPositionWhenUiUpdate)
				{
					if (scintillaGateway.GetSelectionEmpty())
					{
						lastPositionWhenUiUpdate = firstWordSelector.SelectFirstWordOfLine(scintillaGateway);
					}
				}
				return;
			}

			if (notification.Header.Code == (ulong)SciMsg.SCN_MODIFIED)
			{
				var isTextInsertedOrDeleted = (notification.ModificationType &amp;
											   ((int)SciMsg.SC_MOD_INSERTTEXT | (int)SciMsg.SC_MOD_DELETETEXT)) &gt; 0;
				if (isTextInsertedOrDeleted)
				{
					lastPositionWhenUiUpdate = null;
				}
			}
		}
	}
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/16493</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/16493</guid><dc:creator><![CDATA[Kasper Graversen]]></dc:creator><pubDate>Mon, 20 Jun 2016 20:47:20 GMT</pubDate></item><item><title><![CDATA[Reply to Need help with disabling the autocomplete and the &quot;smart hightlighting&quot; on Mon, 20 Jun 2016 01:11:37 GMT]]></title><description><![CDATA[<p dir="auto">Hello Kasper,</p>
<p dir="auto">I’m not a c# expert. We do talk about this code, do we?</p>
<pre><code>    private static void EnsureFirstWordIsSelected(ScNotification notification)
    {
	    if (isPluginActive)
	    {
		    if (notification.Header.Code == (ulong) SciMsg.SCN_UPDATEUI)
		    {
			    var scintillaGateway = new ScintillaGateway(PluginBase.GetCurrentScintilla());
			    var currentPosition = scintillaGateway.GetCurrentPos();
			    if (currentPosition != lastPositionWhenUiUpdate)
			    {
				    if (scintillaGateway.GetSelectionEmpty())
				    {
					    lastPositionWhenUiUpdate = firstWordSelector.SelectFirstWordOfLine(scintillaGateway);
				    }
			    }
			    return;
		    }

		    if (notification.Header.Code == (ulong) SciMsg.SCN_MODIFIED)
		    {
			    var isTextInsertedOrDeleted = (notification.ModificationType &amp;
			                                   ((int) SciMsg.SC_MOD_INSERTTEXT | (int) SciMsg.SC_MOD_DELETETEXT)) &gt; 0;
			    if (isTextInsertedOrDeleted)
			    {
				    var scintillaGateway = new ScintillaGateway(PluginBase.GetCurrentScintilla());
				    firstWordSelector.SelectFirstWordOfLine(scintillaGateway);
			    }
		    }
</code></pre>
<p dir="auto">From my point of view</p>
<pre><code>		    if (notification.Header.Code == (ulong) SciMsg.SCN_MODIFIED)
		    {
			    var isTextInsertedOrDeleted = (notification.ModificationType &amp;
			                                   ((int) SciMsg.SC_MOD_INSERTTEXT | (int) SciMsg.SC_MOD_DELETETEXT)) &gt; 0;
			    if (isTextInsertedOrDeleted)
			    {
				    var scintillaGateway = new ScintillaGateway(PluginBase.GetCurrentScintilla());
				    firstWordSelector.SelectFirstWordOfLine(scintillaGateway);
			    }
		    }
</code></pre>
<p dir="auto">is unnecessary. Let me explain why I’m thinking this is the case.</p>
<p dir="auto">Whenever some adds or deletes text you will get SCN_MODIFIED and SCN_UPDATEUI events for this user action.<br />
So both if statements get always executed and it seems that SCN_MODIFIED if block is just a subset<br />
of SCN_UPDATEUI if block so there is no difference in regards of the editor action.</p>
<p dir="auto">Do I miss something?</p>
<p dir="auto">Cheers<br />
Claudia</p>
]]></description><link>https://community.notepad-plus-plus.org/post/16478</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/16478</guid><dc:creator><![CDATA[Claudia Frank]]></dc:creator><pubDate>Mon, 20 Jun 2016 01:11:37 GMT</pubDate></item><item><title><![CDATA[Reply to Need help with disabling the autocomplete and the &quot;smart hightlighting&quot; on Sun, 19 Jun 2016 18:44:15 GMT]]></title><description><![CDATA[<p dir="auto">Hi Claudia</p>
<p dir="auto">thanks for the reply.</p>
<blockquote>
<p dir="auto">Afaik when you add or delete text you also get an SCN_UPDATEUI message.<br />
So I assume that your EnsureFirstWordIsSelected function does the work twice.</p>
</blockquote>
<p dir="auto">Yes, but Im caching the position of my last selection - so I dont reselect if it is the same position. This reduces the amount of re-selects drastically, but then I need to know if the buffer changes. I’ve found a better experience is to set the cached value to null on buffer change however.</p>
<p dir="auto">Regarding the restart of npp Im not too worried as you wouldn’t do that under a git rebase - but nice to know ;)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/16474</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/16474</guid><dc:creator><![CDATA[Kasper Graversen]]></dc:creator><pubDate>Sun, 19 Jun 2016 18:44:15 GMT</pubDate></item><item><title><![CDATA[Reply to Need help with disabling the autocomplete and the &quot;smart hightlighting&quot; on Fri, 17 Jun 2016 22:10:37 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kasper-graversen" aria-label="Profile: Kasper-Graversen">@<bdi>Kasper-Graversen</bdi></a></p>
<p dir="auto">I assume the SCN_MODIFIED isn’t needed is it?<br />
Afaik when you add or delete text you also get an SCN_UPDATEUI message.<br />
So I assume that your EnsureFirstWordIsSelected function does the work twice.</p>
<p dir="auto">I think one situation isn’t covered (maybe it isn’t needed?).<br />
Assuming that your rebase file is the current active document, restart npp<br />
and you shouldn’t have anything selected, right?<br />
Afaik, when you start/restart npp you don’t get FILE… or BUFFERACTIVATED messages.<br />
I use the READY message to check for.</p>
<p dir="auto">And of course, dail is right. The message isn’t officially supported so you might have a solution which one day breaks.<br />
The only other way I can think of is to call the scintilla clear indicator itself but problem is the same,<br />
an internal code change can break it.</p>
<p dir="auto">So, as my mentor always said, if there is a way to solve the problem, do it, as long as there is no official way to do it.</p>
<p dir="auto">Cheers<br />
Claudia</p>
]]></description><link>https://community.notepad-plus-plus.org/post/16444</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/16444</guid><dc:creator><![CDATA[Claudia Frank]]></dc:creator><pubDate>Fri, 17 Jun 2016 22:10:37 GMT</pubDate></item><item><title><![CDATA[Reply to Need help with disabling the autocomplete and the &quot;smart hightlighting&quot; on Fri, 17 Jun 2016 21:28:37 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dail" aria-label="Profile: dail">@<bdi>dail</bdi></a>  yeah sounds pretty internal. but when N++ exposes no other way, what to do?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/16442</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/16442</guid><dc:creator><![CDATA[Kasper Graversen]]></dc:creator><pubDate>Fri, 17 Jun 2016 21:28:37 GMT</pubDate></item><item><title><![CDATA[Reply to Need help with disabling the autocomplete and the &quot;smart hightlighting&quot; on Fri, 17 Jun 2016 19:14:43 GMT]]></title><description><![CDATA[<p dir="auto">I can’t say for sure but I think <code>NPPM_INTERNAL_xxx</code> are not really meant for plugin developers to use. Not saying they <em>won’t</em> work, just that there may be some caveats when using them (e.g. when and how)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/16439</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/16439</guid><dc:creator><![CDATA[dail]]></dc:creator><pubDate>Fri, 17 Jun 2016 19:14:43 GMT</pubDate></item><item><title><![CDATA[Reply to Need help with disabling the autocomplete and the &quot;smart hightlighting&quot; on Fri, 17 Jun 2016 19:02:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dail" aria-label="Profile: dail">@<bdi>dail</bdi></a>  no worries… I’ll fiddle with it… just found all these internal indicators… man there are a lot of #define’s that are not part of the plugin pack. Maybe I should instead write a simple .h parser and get all those values over to the plugin pack first… yeah I got the NPPM_INTERNAL_CLEARINDICATOR  working… just need to call it at the right moment in time ;)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/16438</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/16438</guid><dc:creator><![CDATA[Kasper Graversen]]></dc:creator><pubDate>Fri, 17 Jun 2016 19:02:46 GMT</pubDate></item><item><title><![CDATA[Reply to Need help with disabling the autocomplete and the &quot;smart hightlighting&quot; on Fri, 17 Jun 2016 18:43:54 GMT]]></title><description><![CDATA[<p dir="auto">Hmm…good question, I’m not sure.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/16437</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/16437</guid><dc:creator><![CDATA[dail]]></dc:creator><pubDate>Fri, 17 Jun 2016 18:43:54 GMT</pubDate></item><item><title><![CDATA[Reply to Need help with disabling the autocomplete and the &quot;smart hightlighting&quot; on Fri, 17 Jun 2016 18:17:41 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dail" aria-label="Profile: dail">@<bdi>dail</bdi></a>  thanks but I still need to detect a change of the cursor position - or is that also regarded a selection? I’ll try it out.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/16436</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/16436</guid><dc:creator><![CDATA[Kasper Graversen]]></dc:creator><pubDate>Fri, 17 Jun 2016 18:17:41 GMT</pubDate></item><item><title><![CDATA[Reply to Need help with disabling the autocomplete and the &quot;smart hightlighting&quot; on Fri, 17 Jun 2016 12:13:38 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kasper-graversen" aria-label="Profile: Kasper-Graversen">@<bdi>Kasper-Graversen</bdi></a></p>
<p dir="auto">The <a href="http://www.scintilla.org/ScintillaDoc.html#SCN_UPDATEUI" rel="nofollow ugc">SCN_UPDATEUI</a> notification carries the <code>SC_UPDATE_SELECTION</code> flag to tell you if the selection has changed. This may help your logic a bit.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/16433</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/16433</guid><dc:creator><![CDATA[dail]]></dc:creator><pubDate>Fri, 17 Jun 2016 12:13:38 GMT</pubDate></item><item><title><![CDATA[Reply to Need help with disabling the autocomplete and the &quot;smart hightlighting&quot; on Fri, 17 Jun 2016 05:15:16 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/claudia-frank" aria-label="Profile: Claudia-Frank">@<bdi>Claudia-Frank</bdi></a> said:</p>
<blockquote>
<p dir="auto">to prevent smart highlighting send NPPM_INTERNAL_CLEARINDICATOR message<br />
and to prevent autocomplete set all possible chars as autoCStops chars.</p>
</blockquote>
<p dir="auto">Great answer Claudia. I figured out the autoCStops  - but I have yet to play around with the clear indicator. Really looking forward to seeing if it works.</p>
<p dir="auto">Now that you are so much into the details of N++ - perhaps you can help me with the eventhandling. The plugin code is basically this one file <a href="https://github.com/kbilsted/NppPluginRebaseAssister/blob/master/RebaseAssister/Main.cs" rel="nofollow ugc">https://github.com/kbilsted/NppPluginRebaseAssister/blob/master/RebaseAssister/Main.cs</a>  the idea is to call the  <code>FirstWordOfLineSelector.SelectFirstWordOfLine</code> every time the cursor moves (and only when there is no selection going on from the user).</p>
<p dir="auto">I couldn’t find an event for that so I’m listening to more events but preventing the “expensive” call to <code>FirstWordOfLineSelector.SelectFirstWordOfLine</code>  by caching the position of the cursor the last time I called <code>FirstWordOfLineSelector.SelectFirstWordOfLine</code> . Also I have a boolean indicating wheather the tab is a file I want to react to or not. But its not as readable as if I could say - if the buffer has changed or the cursor pos has changed.</p>
<p dir="auto">thanks</p>
<p dir="auto">would you mind commenting on my handling of events? To be honest I really only want to recalculate the</p>
]]></description><link>https://community.notepad-plus-plus.org/post/16428</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/16428</guid><dc:creator><![CDATA[Kasper Graversen]]></dc:creator><pubDate>Fri, 17 Jun 2016 05:15:16 GMT</pubDate></item><item><title><![CDATA[Reply to Need help with disabling the autocomplete and the &quot;smart hightlighting&quot; on Thu, 16 Jun 2016 22:54:55 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kasper-graversen" aria-label="Profile: Kasper-Graversen">@<bdi>Kasper-Graversen</bdi></a></p>
<p dir="auto">not officially supported but you could try to do the following</p>
<p dir="auto">to prevent smart highlighting send NPPM_INTERNAL_CLEARINDICATOR message<br />
and to prevent autocomplete set all possible chars as autoCStops chars.</p>
<p dir="auto">Cheers<br />
Claudia</p>
]]></description><link>https://community.notepad-plus-plus.org/post/16420</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/16420</guid><dc:creator><![CDATA[Claudia Frank]]></dc:creator><pubDate>Thu, 16 Jun 2016 22:54:55 GMT</pubDate></item></channel></rss>