<?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[Left Gutter / Space at the begginning of a line / SCI code 2155]]></title><description><![CDATA[<p dir="auto">Years ago I discovered a scintilla message/code that added a left gutter/gap at the beginning of each line in np++.<br />
I’ve been using the following macro at np++ startup, but it stopped stopped working after v7.6.3.</p>
<p dir="auto">&lt;Macro name=“leftGutter” Ctrl=“yes” Alt=“no” Shift=“yes” Key=“71”&gt;<br />
&lt;Action type=“0” message=“2155” wParam=“1” lParam=“12” sParam=“” /&gt;<br />
&lt;/Macro&gt;</p>
<p dir="auto">The reason for using this gap is related to positioning the cursor at the beginning of a line and selecting one or more characters from the beginning of a line using a mouse.<br />
By default in np++, there are less pixels to the left of the first character of a line than other characters that can be used for positioning the cursor and selecting text.</p>
<p dir="auto"><img src="/assets/uploads/files/1619027412572-20ffb4c3-2c04-4194-b3c0-9fccfb4f5131-image.png" alt="20ffb4c3-2c04-4194-b3c0-9fccfb4f5131-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">I found one discussion for reference.<br />
<a href="https://community.notepad-plus-plus.org/topic/20157/how-to-add-a-gap-between-letters-and-border-of-n-window?_=1619023497176&amp;lang=en-US">https://community.notepad-plus-plus.org/topic/20157/how-to-add-a-gap-between-letters-and-border-of-n-window?_=1619023497176&amp;lang=en-US</a><br />
But it mentions adjusting the margin which behaves differently. I believe that left-clicking the margin selects the line text, whereas left-clicking the gutter positions the cursor at the beginning of the line.</p>
<p dir="auto">If anyone has any info on how to get this working on more recent versions, it would be appreciated.</p>
<p dir="auto">Thanks</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/21059/left-gutter-space-at-the-begginning-of-a-line-sci-code-2155</link><generator>RSS for Node</generator><lastBuildDate>Mon, 07 Sep 2026 02:29:45 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/21059.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 21 Apr 2021 18:01:00 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Left Gutter / Space at the begginning of a line / SCI code 2155 on Thu, 22 Apr 2021 15:20:05 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a><br />
<a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a><br />
<a class="plugin-mentions-user plugin-mentions-a" href="/user/dinkumoil" aria-label="Profile: dinkumoil">@<bdi>dinkumoil</bdi></a></p>
<p dir="auto">Thank you all for the very detailed information and explanation of why it doesn’t work anymore. I wasn’t expecting so much.<br />
np++ is the best editor I’ve used in my 20 years as a PeopleSoft developer. I look forward to the left-padding setting, but will give <a href="http://startup.py" rel="nofollow ugc">startup.py</a> a shot for now.<br />
-Adam</p>
]]></description><link>https://community.notepad-plus-plus.org/post/65240</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/65240</guid><dc:creator><![CDATA[Adam West]]></dc:creator><pubDate>Thu, 22 Apr 2021 15:20:05 GMT</pubDate></item><item><title><![CDATA[Reply to Left Gutter / Space at the begginning of a line / SCI code 2155 on Thu, 22 Apr 2021 07:59:43 GMT]]></title><description><![CDATA[<p dir="auto">[OFF TOPIC]</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a> said in <a href="/post/65222">Left Gutter / Space at the begginning of a line / SCI code 2155</a>:</p>
<blockquote>
<p dir="auto">PythonScript has the benefit that it can set both views (normal view and other view) in the same script; with NppExec, it will only affect the active view.</p>
</blockquote>
<p dir="auto">FYI: <em>NppExec</em> can send window messages to arbitrary windows, thus it can send messages to both <em>Scintilla</em> views. The tricky part is how to get the <em>Scintilla</em> window handles, see the following code:</p>
<pre><code class="language-Z">npp_sendmsg NPPM_GETCURRENTVIEW
set local $(CurView) = $(MSG_RESULT)

npp_sendmsg NPPM_ACTIVATEDOC 0 -1
set local $(SCI1_HWND) = $(SCI_HWND)

npp_sendmsg NPPM_ACTIVATEDOC 1 -1
set local $(SCI2_HWND) = $(SCI_HWND)

npp_sendmsg NPPM_ACTIVATEDOC $(CurView) -1
</code></pre>
<p dir="auto">After executing this code the original view is the active view again and you have two variables <em>$(SCI1_HWND)</em> and <em>$(SCI2_HWND)</em> containing the window handles of the two <em>Scintilla</em> views. Now you can use <em>npp_sendmsgex</em> to send messages to them:</p>
<pre><code class="language-Z">npp_sendmsgex $(SCI2_HWND) SCI_GETTEXTLENGTH
echo Text length: $(MSG_RESULT)
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/65235</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/65235</guid><dc:creator><![CDATA[dinkumoil]]></dc:creator><pubDate>Thu, 22 Apr 2021 07:59:43 GMT</pubDate></item><item><title><![CDATA[Reply to Left Gutter / Space at the begginning of a line / SCI code 2155 on Wed, 21 Apr 2021 19:30:55 GMT]]></title><description><![CDATA[<p dir="auto">There will be a new setting in the next release of Notepad++, presumed to be 7.9.6 that probably helps with the OP’s need.</p>
<hr />
<p dir="auto">Here’s an example of the existing way it is, and the new setting with <em>Left Padding</em> set to zero:</p>
<p dir="auto"><img src="/assets/uploads/files/1619033229215-f016a04a-c682-4f42-8f7c-e69a97bc671c-image.png" alt="f016a04a-c682-4f42-8f7c-e69a97bc671c-image.png" class=" img-fluid img-markdown" /></p>
<hr />
<p dir="auto">Contrast that with a non-zero setting for it:</p>
<p dir="auto"><img src="/assets/uploads/files/1619033265822-ad96e9a4-c03e-4590-9169-0c28a0ffb25b-image.png" alt="ad96e9a4-c03e-4590-9169-0c28a0ffb25b-image.png" class=" img-fluid img-markdown" /></p>
<hr />
<p dir="auto">And yes, it does help make mouse-selecting a column 1 character a bit easier (the only real practical use I see for it).</p>
]]></description><link>https://community.notepad-plus-plus.org/post/65224</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/65224</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Wed, 21 Apr 2021 19:30:55 GMT</pubDate></item><item><title><![CDATA[Reply to Left Gutter / Space at the begginning of a line / SCI code 2155 on Thu, 22 Apr 2021 08:01:12 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/adam-west" aria-label="Profile: Adam-West">@<bdi>Adam-West</bdi></a></p>
<p dir="auto">Back in February 2019 the European Community started a bug bounty program called <em>EU-FOSSA</em> (short for <em>Free and Open Source Software Auditing</em>) to find critical security issues in widely used open source software. Notepad++ was one of the projects that have undergone an audit.</p>
<p dir="auto">As a reaction to one of the security issues found during this audit, <a href="https://github.com/notepad-plus-plus/notepad-plus-plus/commit/70cd3e5ea69b95392c88cb0fc2b9eba0f3de0c82" rel="nofollow ugc">&gt;&gt; at February, 21st 2019 there has been made a commit &lt;&lt;</a> to the Notepad++ code base to prevent the software from executing arbitrary <em>Scintilla</em> commands from the <em>shortcuts.xml</em> file in order to prevent hackers from being able to create harmful macros by changing this file. This afore mentioned commit introduced a white-list of <em>Scintilla</em> commands considered to be safe for execution from within a macro. Unfortunately the commmand <em>SCI_SETMARGINLEFT</em> (whose numeric representation is the number 2155 that you use in your macro) is not part of that list.</p>
<p dir="auto">Since the commit mentioned above has been made in between the release of Notepad++ v7.6.3 and v7.6.4, the last version where your macro should work is v7.6.3. But the whole v7.6.x branch of Notepad++ versions was experimental due to heavy changes in plugin loading and management (the v7.6.x branch made the old external <em>Plugin Manager</em> obsolete, new internal <em>Plugins Admin</em> has been introduced and lots of plugins had to be updated to meet the new requirements that arose from these changes). Thus it is <strong>NOT recommended to roll back to v7.6.3</strong>.</p>
<p dir="auto">The only way to get back the ability to run your macro in recent releases of Notepad++ is filing a feature request at the project’s GitHub repository. Please <a href="https://community.notepad-plus-plus.org/topic/15741/faq-desk-feature-request-or-bug-report">&gt;&gt; read this &lt;&lt;</a> to learn how to do that.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/65223</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/65223</guid><dc:creator><![CDATA[dinkumoil]]></dc:creator><pubDate>Thu, 22 Apr 2021 08:01:12 GMT</pubDate></item><item><title><![CDATA[Reply to Left Gutter / Space at the begginning of a line / SCI code 2155 on Wed, 21 Apr 2021 18:52:12 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/adam-west" aria-label="Profile: Adam-West">@<bdi>Adam-West</bdi></a> ,</p>
<blockquote>
<p dir="auto">&lt;Action type=“0” message=“2155” wParam=“1” lParam=“12” sParam=“” /&gt;</p>
</blockquote>
<p dir="auto">Hmm, I would have expected that to still work.  Or maybe a slightly modified</p>
<pre><code>&lt;Action type="0" message="2155" wParam="0" lParam="12" sParam="" /&gt;
</code></pre>
<p dir="auto">… because the SCI_SETMARGINLEFT doesn’t expect a wParam, and as the <a href="https://npp-user-manual.org/docs/config-files/#macros" rel="nofollow ugc">&lt;macros&gt; documentation</a> says, “Use 0 if the message or command doesn’t require a wParam.”</p>
<p dir="auto">However, I just tried on v7.9.5, and it doesn’t.  Notepad++ may have taken 2155 = SCI_SETMARGINLEFT out of its list of macro-recordable/macro-playable actions.  I am not sure why it would have done so, because it meets the requirements that are generally applied for recording scintilla actions; but so it goes.</p>
<p dir="auto">That said, both NppExec and PythonScript can easily handle sending those messages, and can put their scripts into a menu that you can assign keyboard shortcuts to.  The discussion you linked even shows how to put the <code>editor.setMarginLeft(12)</code> in <code>startup.py</code> to make it live all the time; if you want it user-decided, then you could just create a new script rather than using <code>startup.py</code> as shown.  And NppExec can do it via <code>sci_sendmsg 2155 0 12</code> .  (PythonScript has the benefit that it can set both views (normal view and other view) in the same script; with NppExec, it will only affect the active view.)</p>
<p dir="auto">Sorry it doesn’t work in the builtin macros anymore.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/65222</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/65222</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Wed, 21 Apr 2021 18:52:12 GMT</pubDate></item><item><title><![CDATA[Reply to Left Gutter / Space at the begginning of a line / SCI code 2155 on Wed, 21 Apr 2021 18:07:46 GMT]]></title><description><![CDATA[<p dir="auto">To Clarify:<br />
<img src="/assets/uploads/files/1619028419795-b3df4d50-9d46-4fb7-9fe3-c09a22caed56-image.png" alt="b3df4d50-9d46-4fb7-9fe3-c09a22caed56-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.notepad-plus-plus.org/post/65220</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/65220</guid><dc:creator><![CDATA[Adam West]]></dc:creator><pubDate>Wed, 21 Apr 2021 18:07:46 GMT</pubDate></item></channel></rss>