<?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[New bug with &quot;Execute this script when Notepad++ starts&quot;?]]></title><description><![CDATA[<p dir="auto">Version: 8.1.2 (64-bit)</p>
<p dir="auto">I have a very simple script defined in “NppExec Advanced Options” under “Execute this script when Notepad++ starts”.  It’s been running fine since it was added, but today I noticed that the change the script makes no longer works.</p>
<p dir="auto">However, if I copy the script text to the Console and run it, then the change does take affect. It appears that “Execute this script when Notepad++ starts” is no longer working.  Is this a new bug, or did I unintentionally break it somehow?</p>
<p dir="auto">Here’s my script.  It changes my Tab behavior to the way I want it.</p>
<pre><code>NPP_CONSOLE 0
SCI_SENDMSG SCI_SETTABINDENTS 0
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/topic/21693/new-bug-with-execute-this-script-when-notepad-starts</link><generator>RSS for Node</generator><lastBuildDate>Wed, 15 Jul 2026 13:15:23 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/21693.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 19 Aug 2021 16:37:06 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to New bug with &quot;Execute this script when Notepad++ starts&quot;? on Mon, 23 Aug 2021 16:56:03 GMT]]></title><description><![CDATA[<p dir="auto">BTW, the script may not work for the file active when N++ starts up.  A workaround would be to add this line at the end of the <code>__init__</code> function:</p>
<p dir="auto"><code>self.bufferactivated_notify(None)</code></p>
]]></description><link>https://community.notepad-plus-plus.org/post/69199</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/69199</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Mon, 23 Aug 2021 16:56:03 GMT</pubDate></item><item><title><![CDATA[Reply to New bug with &quot;Execute this script when Notepad++ starts&quot;? on Mon, 23 Aug 2021 14:31:04 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vtgroupgithub" aria-label="Profile: VTGroupGitHub">@<bdi>VTGroupGitHub</bdi></a> said in <a href="/post/69190">New bug with "Execute this script when Notepad++ starts"?</a>:</p>
<blockquote>
<p dir="auto">the first bullet is no longer needed with the new PythonScript</p>
</blockquote>
<p dir="auto">I agree.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/69193</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/69193</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Mon, 23 Aug 2021 14:31:04 GMT</pubDate></item><item><title><![CDATA[Reply to New bug with &quot;Execute this script when Notepad++ starts&quot;? on Mon, 23 Aug 2021 14:05:20 GMT]]></title><description><![CDATA[<p dir="auto">Thank you again to everyone for the input.  It’s now working the way I want in all cases.   In case anyone else is looking for the behavior, the solution requires:</p>
<ul>
<li>The original script that’s configured to execute when NPP starts in “NppExec Advanced Options”:</li>
</ul>
<pre><code>NPP_CONSOLE 0
SCI_SENDMSG SCI_SETTABINDENTS 0
</code></pre>
<ul>
<li>Alan’s PythonScript above that I added to <strong><a href="http://startup.py" rel="nofollow ugc">startup.py</a></strong>.  (Thanks Alan!)</li>
</ul>
<pre><code>from Npp import *

class FixTabOnStartup(object):

    def __init__(self):
        notepad.callback(self.bufferactivated_notify, [NOTIFICATION.BUFFERACTIVATED])

    def bufferactivated_notify(self, args):
        editor.setTabIndents(False)

if __name__ == '__main__': FixTabOnStartup()
</code></pre>
<ul>
<li>Changing “Initialisation” to “ATSTARTUP” in the “Python Script Configuration” dialog.</li>
</ul>
<p dir="auto">After typing all of this, though, it’s possible the first bullet is no longer needed with the new PythonScript ?  I’ll have to validate later.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/69190</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/69190</guid><dc:creator><![CDATA[VTGroupGitHub]]></dc:creator><pubDate>Mon, 23 Aug 2021 14:05:20 GMT</pubDate></item><item><title><![CDATA[Reply to New bug with &quot;Execute this script when Notepad++ starts&quot;? on Sat, 21 Aug 2021 07:17:43 GMT]]></title><description><![CDATA[<p dir="auto">The Increase Line Indent feature works kind of different. The caret is not moved at all when indentation is increased. It stays at the current/previous position. So the script solution to modify SCI_SETTABINDENTS is needed.</p>
<p dir="auto">Taking the example from the other thread:</p>
<ol>
<li>Have text in one line: column 0 starting with 8 spaces, at column 9 following some text.</li>
<li>Caret is at column 0.</li>
<li>Increase Line Indent.</li>
<li>Indentation is increased (test starts at 13), but caret stays at column 0.</li>
</ol>
<p dir="auto">And other way round</p>
<ol>
<li>Have text in one line: column 0 starting with 8 spaces, at column 9 following some text.</li>
<li>Caret is at column 11.</li>
<li>Increase Line Indent.</li>
<li>Indentation is increased (test starts at 13), but caret “stays” at column 15.</li>
</ol>
]]></description><link>https://community.notepad-plus-plus.org/post/69140</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/69140</guid><dc:creator><![CDATA[MarkusBodensee]]></dc:creator><pubDate>Sat, 21 Aug 2021 07:17:43 GMT</pubDate></item><item><title><![CDATA[Reply to New bug with &quot;Execute this script when Notepad++ starts&quot;? on Fri, 20 Aug 2021 19:37:05 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vtgroupgithub" aria-label="Profile: VTGroupGitHub">@<bdi>VTGroupGitHub</bdi></a> said in <a href="/post/69129">New bug with "Execute this script when Notepad++ starts"?</a>:</p>
<blockquote>
<p dir="auto">It explains the behavior I was after, and a solution that seemed to work.</p>
</blockquote>
<p dir="auto">Ok, so I read the other thread and I “get it” now.  :-)<br />
Without the background info, I found it confusing.<br />
Nice to have all of the info now.</p>
<p dir="auto">So I experimented with this command on the <em>Indent</em> submenu of the <em>Edit</em> main menu (by assigning it a dummy keycombo, Ctrl+e):</p>
<p dir="auto"><img src="/assets/uploads/files/1629488107538-3b666303-ee23-409b-92d2-d527596c5091-image.png" alt="3b666303-ee23-409b-92d2-d527596c5091-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">This also seems to do what you want?<br />
OK, not 100% on that because I’m not you. :-)<br />
But you might want to experiment with it.</p>
<p dir="auto">If it worked out, you could forget using a script, and just reassign the Tab and Shift+Tab commands, over to those shown in the screenshot.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/69133</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/69133</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Fri, 20 Aug 2021 19:37:05 GMT</pubDate></item><item><title><![CDATA[Reply to New bug with &quot;Execute this script when Notepad++ starts&quot;? on Fri, 20 Aug 2021 19:27:22 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vtgroupgithub" aria-label="Profile: VTGroupGitHub">@<bdi>VTGroupGitHub</bdi></a></p>
<p dir="auto">Here’s a PythonScript that should do what you’re looking for:</p>
<pre><code class="language-z"># -*- coding: utf-8 -*-

from Npp import *

class T21693(object):

    def __init__(self):
        notepad.callback(self.bufferactivated_notify, [NOTIFICATION.BUFFERACTIVATED])

    def bufferactivated_notify(self, args):
        editor.setTabIndents(False)

if __name__ == '__main__': T21693()
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/69132</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/69132</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Fri, 20 Aug 2021 19:27:22 GMT</pubDate></item><item><title><![CDATA[Reply to New bug with &quot;Execute this script when Notepad++ starts&quot;? on Fri, 20 Aug 2021 19:18:37 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vtgroupgithub" aria-label="Profile: VTGroupGitHub">@<bdi>VTGroupGitHub</bdi></a> said in <a href="/post/69129">New bug with "Execute this script when Notepad++ starts"?</a>:</p>
<blockquote>
<p dir="auto">I’m not sure if you’re asking me or one of the other two that commented on this question?</p>
</blockquote>
<p dir="auto">I was asking you since you seem to be best equipped to answer, but really, anyone could have responded with info.</p>
<blockquote>
<p dir="auto">this post is actually a follow-on from my post last year called “Make tab key just insert 4 spaces, not insert 4 spaces AND move to the first char on the line”.  It explains the behavior I was after, and a solution that seemed to work.</p>
</blockquote>
<p dir="auto">That thread is <a href="https://community.notepad-plus-plus.org/topic/19283">HERE</a>.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/69130</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/69130</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Fri, 20 Aug 2021 19:18:37 GMT</pubDate></item><item><title><![CDATA[Reply to New bug with &quot;Execute this script when Notepad++ starts&quot;? on Fri, 20 Aug 2021 19:15:40 GMT]]></title><description><![CDATA[<p dir="auto">I’m not sure if you’re asking me or one of the other two that commented on this question?</p>
<p dir="auto">If it’s me, this post is actually a follow-on from my post last year called <strong>“Make tab key just insert 4 spaces, not insert 4 spaces AND move to the first char on the line”</strong>.  It explains the behavior I was after, and a solution that seemed to work.</p>
<p dir="auto">Now I realize that I didn’t really test all combinations, so my post yesterday was not a “New bug”, but rather me seeing the “container specific” scenarios for the first time.</p>
<p dir="auto">It’s not all wasted, though, as the PythonScript addition sounds like something I need anyway to get my original question working all the time.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/69129</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/69129</guid><dc:creator><![CDATA[VTGroupGitHub]]></dc:creator><pubDate>Fri, 20 Aug 2021 19:15:40 GMT</pubDate></item><item><title><![CDATA[Reply to New bug with &quot;Execute this script when Notepad++ starts&quot;? on Fri, 20 Aug 2021 18:15:55 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vtgroupgithub" aria-label="Profile: VTGroupGitHub">@<bdi>VTGroupGitHub</bdi></a></p>
<p dir="auto">Excuse my ignorance, but I’m uncertain about the functionality provided by SCI_SETTABINDENTS.  From its docs:</p>
<p dir="auto"><code>Inside indentation white space, the tab and backspace keys can be made to indent and unindent rather than insert a tab character or delete a character with the SCI_SETTABINDENTS and SCI_SETBACKSPACEUNINDENTS functions.</code></p>
<p dir="auto">If your caret is in the “indention whitespace” – presume this means between the start of line and the first non-whitespace character – the tab key will “indent”…but what does that (indention) even mean if it isn’t inserting <em>something</em>, be it a tab character or a certain amount of spaces…?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/69127</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/69127</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Fri, 20 Aug 2021 18:15:55 GMT</pubDate></item><item><title><![CDATA[Reply to New bug with &quot;Execute this script when Notepad++ starts&quot;? on Fri, 20 Aug 2021 15:44:38 GMT]]></title><description><![CDATA[<p dir="auto">That is a great answer!  Thank you.  And it does match my observations, with the updated Test 2 below.  I just can’t figure out how I haven’t noticed it before.</p>
<p dir="auto">I’ll try your suggestion and report back if my PythonScript might be useful for someone.</p>
<p dir="auto">Here’s the real Test 2, with an additional Test 3:</p>
<p dir="auto">Test 2:<br />
1 - Open an existing file after NPP is already open. It <strong>doesn’t</strong> work in that tab.</p>
<p dir="auto">Test 3:<br />
1 - Double-click on an existing, so that it opens in NPP. It does work in that tab.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/69117</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/69117</guid><dc:creator><![CDATA[VTGroupGitHub]]></dc:creator><pubDate>Fri, 20 Aug 2021 15:44:38 GMT</pubDate></item><item><title><![CDATA[Reply to New bug with &quot;Execute this script when Notepad++ starts&quot;? on Fri, 20 Aug 2021 15:20:57 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vtgroupgithub" aria-label="Profile: VTGroupGitHub">@<bdi>VTGroupGitHub</bdi></a> said in <a href="/post/69114">New bug with "Execute this script when Notepad++ starts"?</a>:</p>
<blockquote>
<p dir="auto">SCI_SETTABINDENTS</p>
</blockquote>
<p dir="auto">This I believe is a “container” specific option - meaning Notepad++ sets this each time a new tab is opened.  Setting it at startup only affects the current container - not any new ones.  You can use <a href="http://npppythonscript.sourceforge.net/" rel="nofollow ugc">PythonScript</a> to set a callback event for <code>NOTIFICATION.BUFFERACTIVATED</code> and have PythonScript set this for you as you switch tabs.</p>
<p dir="auto">Cheers.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/69115</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/69115</guid><dc:creator><![CDATA[Michael Vincent]]></dc:creator><pubDate>Fri, 20 Aug 2021 15:20:57 GMT</pubDate></item><item><title><![CDATA[Reply to New bug with &quot;Execute this script when Notepad++ starts&quot;? on Fri, 20 Aug 2021 15:10:18 GMT]]></title><description><![CDATA[<p dir="auto">Thank you. This is what I see in that section in <strong>NPPExec.ini</strong>, which is the correct script name:</p>
<pre><code>[Options]
ScriptNppStart="FixTabOnStartup"
ToolbarBtn=0
</code></pre>
<p dir="auto">And I see this in <strong>npes_saved.txt</strong>:</p>
<pre><code>::FixTabOnStartup
NPP_CONSOLE 0
SCI_SENDMSG SCI_SETTABINDENTS 0
</code></pre>
<p dir="auto">However, here’s a new observation this morning which I can’t explain yet:</p>
<p dir="auto">Test 1:<br />
1 - Create a new file. It works in that tab.<br />
2 - Save the new file.  It still works in that tab.<br />
3 - Open a second existing file.  It <strong>doesn’t</strong> work in that second tab.<br />
4 - Tab back to the first file. It still works in the first tab.</p>
<p dir="auto">Test 2:<br />
1 - Open an existing file.  It <strong>doesn’t</strong> work in that tab.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/69114</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/69114</guid><dc:creator><![CDATA[VTGroupGitHub]]></dc:creator><pubDate>Fri, 20 Aug 2021 15:10:18 GMT</pubDate></item><item><title><![CDATA[Reply to New bug with &quot;Execute this script when Notepad++ starts&quot;? on Thu, 19 Aug 2021 22:41:40 GMT]]></title><description><![CDATA[<p dir="auto">Is your <code>NppExec.ini</code> still properly configured?  It should be in the “plugins\Config” folder and the <code>[Options]</code> section needs to state the name of the startup script contained in the <code>npes_saved.txt</code> file.  Of course, use the names and capitalization you desire, but they must match.</p>
<pre><code>[Options]
ScriptNppStart="NPP_STARTS"
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/69102</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/69102</guid><dc:creator><![CDATA[artie-finkelstein]]></dc:creator><pubDate>Thu, 19 Aug 2021 22:41:40 GMT</pubDate></item></channel></rss>