<?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[remove Space &amp; Break line while Copying a line in notepad++]]></title><description><![CDATA[<p dir="auto">When I triple-click and highlight a line to copy it … it copies an extra space and break line with it.<br />
<strong>The question is:</strong><br />
How to just copy it without spaces and break line?</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/23381/remove-space-break-line-while-copying-a-line-in-notepad</link><generator>RSS for Node</generator><lastBuildDate>Wed, 17 Jun 2026 03:51:36 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/23381.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 16 Aug 2022 08:27:29 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to remove Space &amp; Break line while Copying a line in notepad++ on Wed, 31 Aug 2022 15:15:22 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/andi-kiissel" aria-label="Profile: Andi-Kiissel">@<bdi>Andi-Kiissel</bdi></a> said i:</p>
<blockquote>
<p dir="auto">With WordWrap=ON this script behaves differently than Scintilla End/Shift+End default, but that’s OK for me</p>
</blockquote>
<p dir="auto">I considered this case, but I didn’t see an easy way to handle it.<br />
As line “breaks” caused by word-wrap are artificial, it would be extremely rare for me to want to move to one.<br />
So wrap consideration got defeatured from the spec for this problem. :-)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/79473</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/79473</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Wed, 31 Aug 2022 15:15:22 GMT</pubDate></item><item><title><![CDATA[Reply to remove Space &amp; Break line while Copying a line in notepad++ on Wed, 31 Aug 2022 15:08:36 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/andi-kiissel" aria-label="Profile: Andi-Kiissel">@<bdi>Andi-Kiissel</bdi></a> said in <a href="/post/79464">remove Space &amp; Break line while Copying a line in notepad++</a>:</p>
<blockquote>
<p dir="auto">editor.setSel(editor.getAnchor() if is_selecting else new_caret_pos, new_caret_pos)  (NB! arguments swapped!)</p>
</blockquote>
<p dir="auto">Another good suggestion. :-)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/79472</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/79472</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Wed, 31 Aug 2022 15:08:36 GMT</pubDate></item><item><title><![CDATA[Reply to remove Space &amp; Break line while Copying a line in notepad++ on Wed, 31 Aug 2022 11:24:16 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a></p>
<p dir="auto">I propose one more significant change to this script:<br />
If the line is longer than width of the window and <code>WordWrap=OFF</code> then with <code>editor.setSelection</code> the caret (cursor) remains invisible (outside the window).<br />
Better to use<br />
<code>editor.setSel(editor.getAnchor() if is_selecting else new_caret_pos, new_caret_pos)</code>  <em>(NB! arguments swapped!)</em><br />
which moves the view as needed.<br />
With <code>WordWrap=ON</code> this script behaves differently than Scintilla <code>End</code>/<code>Shift+End</code> default, but that’s OK for me :)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/79464</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/79464</guid><dc:creator><![CDATA[Andi Kiissel]]></dc:creator><pubDate>Wed, 31 Aug 2022 11:24:16 GMT</pubDate></item><item><title><![CDATA[Reply to remove Space &amp; Break line while Copying a line in notepad++ on Tue, 30 Aug 2022 19:05:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/andi-kiissel" aria-label="Profile: Andi-Kiissel">@<bdi>Andi-Kiissel</bdi></a> said in <a href="/post/79452">remove Space &amp; Break line while Copying a line in notepad++</a>:</p>
<blockquote>
<p dir="auto">I didn’t realize until now that if <code>Remove</code> isn’t available and <code>None</code> with <code>OK</code> don’t work, then <code>None</code> with <code>Apply</code> do!<br />
Thanks for emphasizing that it’s best to unmap those keys first!</p>
</blockquote>
<p dir="auto">BTW: per Alan’s recent prompting, <a href="https://github.com/pryrt/npp-usermanual/blob/76767413b409236832785d6d7bc17464def7e81e/content/docs/preferences.md#:~:text=For%20entries%20on%20the,hit%20OK%20to%20finish." rel="nofollow ugc">the documentation has been updated</a> in the github copy of the online user manual to reflect that oddity.  The next time the usermanual is pushed to <a href="http://npp-user-manual.org" rel="nofollow ugc">npp-user-manual.org</a> (probably after the <em>next</em> release of Notepad++ (v8.4.5 or v8.5 or whatever it’s called)), the updated instructions will be there.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/79456</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/79456</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Tue, 30 Aug 2022 19:05:32 GMT</pubDate></item><item><title><![CDATA[Reply to remove Space &amp; Break line while Copying a line in notepad++ on Tue, 30 Aug 2022 18:58:10 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/andi-kiissel" aria-label="Profile: Andi-Kiissel">@<bdi>Andi-Kiissel</bdi></a> said in <a href="/post/79452">remove Space &amp; Break line while Copying a line in notepad++</a>:</p>
<blockquote>
<p dir="auto">I didn’t realize until now that if Remove isn’t available and None with OK don’t work, then None with Apply do!</p>
</blockquote>
<p dir="auto">See:</p>
<ul>
<li>
<p dir="auto"><a href="https://github.com/notepad-plus-plus/notepad-plus-plus/issues/12040#:~:text=Remove%20button%20is%20disabled%20and%20user%20has%20to%20resort%20to%20the%20unintuitive%20method%20of%20picking%20None%20from%20the%20dropdown%20and%20clicking%20Apply" rel="nofollow ugc">https://github.com/notepad-plus-plus/notepad-plus-plus/issues/12040#:~:text=Remove button is disabled and user has to resort to the unintuitive method of picking None from the dropdown and clicking Apply</a></p>
</li>
<li>
<p dir="auto"><a href="https://github.com/notepad-plus-plus/notepad-plus-plus/issues/12034" rel="nofollow ugc">https://github.com/notepad-plus-plus/notepad-plus-plus/issues/12034</a></p>
</li>
</ul>
]]></description><link>https://community.notepad-plus-plus.org/post/79453</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/79453</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Tue, 30 Aug 2022 18:58:10 GMT</pubDate></item><item><title><![CDATA[Reply to remove Space &amp; Break line while Copying a line in notepad++ on Tue, 30 Aug 2022 18:55:24 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a> said:</p>
<blockquote>
<p dir="auto">I do know something about how keys are processed, but I think the easiest/safest thing if someone wants to use the script(s) here is to first go in and unmap End and Shift+End, then assign them to the script(s).</p>
</blockquote>
<p dir="auto">I didn’t realize until now that if <code>Remove</code> isn’t available and <code>None</code> with <code>OK</code> don’t work, then <code>None</code> with <code>Apply</code> do!<br />
Thanks for emphasizing that it’s best to unmap those keys first!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/79452</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/79452</guid><dc:creator><![CDATA[Andi Kiissel]]></dc:creator><pubDate>Tue, 30 Aug 2022 18:55:24 GMT</pubDate></item><item><title><![CDATA[Reply to remove Space &amp; Break line while Copying a line in notepad++ on Tue, 30 Aug 2022 13:22:05 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/andi-kiissel" aria-label="Profile: Andi-Kiissel">@<bdi>Andi-Kiissel</bdi></a> said:</p>
<blockquote>
<p dir="auto">I’d suggest to add editor.chooseCaretX() after editor.setSelection… to remember caret new horizontal position for next up/down moves</p>
</blockquote>
<p dir="auto">Yes, that’s a very good idea.</p>
<hr />
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/andi-kiissel" aria-label="Profile: Andi-Kiissel">@<bdi>Andi-Kiissel</bdi></a> said :</p>
<blockquote>
<p dir="auto">Remapping of End and Shift+End works even with conflicts with Scintilla default commands, but I don’t know, what exactly is going on in behind :) These keys can be disabled in Scintilla with SCI_CLEARCMDKEY, but they remain in N++ Shortcut Mapper as conflicts. May this be a problem somehow, I don’t know.</p>
</blockquote>
<p dir="auto">I do know something about how keys are processed, but I think the easiest/safest thing if someone wants to use the script(s) here is to first go in and unmap End and Shift+End, then assign them to the script(s).</p>
]]></description><link>https://community.notepad-plus-plus.org/post/79432</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/79432</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Tue, 30 Aug 2022 13:22:05 GMT</pubDate></item><item><title><![CDATA[Reply to remove Space &amp; Break line while Copying a line in notepad++ on Tue, 30 Aug 2022 07:55:26 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a><br />
<code>Home</code> and <code>End</code> different behavior with whitespaces disturbed me too. This script is very clever, thank you!<br />
I’d suggest to add <code>editor.chooseCaretX()</code> after <code>editor.setSelection...</code> to remember caret new horizontal position for next up/down moves.<br />
Remapping of <code>End</code> and <code>Shift+End</code> works even with conflicts with Scintilla default commands, but I don’t know, what exactly is going on in behind :) These keys can be disabled in Scintilla with <code>SCI_CLEARCMDKEY</code>, but they remain in N++ Shortcut Mapper as conflicts. May this be a problem somehow, I don’t know.<br />
Thanks again for this useful idea and script!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/79427</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/79427</guid><dc:creator><![CDATA[Andi Kiissel]]></dc:creator><pubDate>Tue, 30 Aug 2022 07:55:26 GMT</pubDate></item><item><title><![CDATA[Reply to remove Space &amp; Break line while Copying a line in notepad++ on Mon, 29 Aug 2022 15:06:46 GMT]]></title><description><![CDATA[<p dir="auto">So the OP’s desire to select to end of line content, but not any trailing whitespace, got me thinking about how using the Shift+End keycombo works in comparison to Shift+Home.</p>
<p dir="auto">Shift+End will select to the end of data (be it whitespace or not), just before the end-of-line character(s) on a line.  Shift+Home, however, selects from current position to the first non-whitespace on a line.  If, after doing Shift+Home the first time, the user presses it again, THEN it will extend the selection to column 1.</p>
<p dir="auto">But really, why this difference?  Why shouldn’t Shift+End first select to the last non-whitespace character on a line, then a subsequent re-press of that keycombo selects the remaining (less line-ending char(s))?  I mean, one could argue it either way, but I say “why not act similarly”?</p>
<p dir="auto">So I wrote a script to provide this functionality for Shift+End (and End alone as well).  I call the script <code>EndKeyReplacementFunctionality.py</code> and here it is:</p>
<pre><code># -*- coding: utf-8 -*-
from __future__ import print_function

# references:
#  https://community.notepad-plus-plus.org/topic/23381

from Npp import *
from ctypes import (WinDLL)

#-------------------------------------------------------------------------------

class EKRF(object):

    def __init__(self):
        VK_SHIFT = 0x10
        is_selecting = (WinDLL('user32').GetAsyncKeyState(VK_SHIFT) &amp; 0x8000) != 0
        if editor.selectionIsRectangle():
            editor.lineEndRectExt() if is_selecting else editor.lineEndDisplay()
            return
        if editor.getSelections() &gt; 1:
            editor.lineEndWrapExtend() if is_selecting else editor.lineEndWrap()
            return
        caret_pos = editor.getCurrentPos()
        cur_line = editor.lineFromPosition(caret_pos)
        cur_line_end_pos = editor.getLineEndPosition(cur_line)
        match_pos_list = []
        editor.research(r'\h+$', lambda m: match_pos_list.append(m.span(0)[0]), 0, editor.positionFromLine(cur_line), cur_line_end_pos, 1)
        new_caret_pos = cur_line_end_pos if (len(match_pos_list) == 0 or caret_pos == match_pos_list[0]) else match_pos_list[0]
        editor.setSelection(new_caret_pos, editor.getAnchor() if is_selecting else new_caret_pos)

#-------------------------------------------------------------------------------

if __name__ == '__main__': EKRF()
</code></pre>
<p dir="auto">To use the script, remap the shortcut for the Shift+End keycombo from its default function to run this script instead.</p>
<p dir="auto">To have the functionality for the End key alone requires a second script with a similar keycombo remapping.  The scripts can be identical; what I did was just copy <code>EndKeyReplacementFunctionality.py</code> to <code>EndKeyReplacementFunctionality2.py</code>.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/79418</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/79418</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Mon, 29 Aug 2022 15:06:46 GMT</pubDate></item><item><title><![CDATA[Reply to remove Space &amp; Break line while Copying a line in notepad++ on Mon, 22 Aug 2022 20:28:35 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sultan" aria-label="Profile: Sultan">@<bdi>Sultan</bdi></a> said in <a href="/post/79225">remove Space &amp; Break line while Copying a line in notepad++</a>:</p>
<blockquote>
<p dir="auto">this is too tough to copy</p>
</blockquote>
<p dir="auto">If you stick to keyboard actions, you can make a <a href="https://npp-user-manual.org/docs/macros/" rel="nofollow ugc">MACRO</a> of the whole sequence:</p>
<ul>
<li>press Home twice</li>
<li>press Shift+End</li>
<li>press Ctrl+c</li>
</ul>
<p dir="auto">Then assign the macro to a keycombo.<br />
Can’t be any quicker than that.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/79228</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/79228</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Mon, 22 Aug 2022 20:28:35 GMT</pubDate></item><item><title><![CDATA[Reply to remove Space &amp; Break line while Copying a line in notepad++ on Fri, 19 Aug 2022 05:32:50 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a> this is too tough to copy<br />
I just want to highlight and copy real quick.<br />
How about deleting the space character at the end of the line??</p>
]]></description><link>https://community.notepad-plus-plus.org/post/79225</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/79225</guid><dc:creator><![CDATA[Sultan]]></dc:creator><pubDate>Fri, 19 Aug 2022 05:32:50 GMT</pubDate></item><item><title><![CDATA[Reply to remove Space &amp; Break line while Copying a line in notepad++ on Tue, 16 Aug 2022 12:06:41 GMT]]></title><description><![CDATA[<blockquote>
<blockquote>
<p dir="auto">it copies an extra space</p>
</blockquote>
</blockquote>
<blockquote>
<p dir="auto">I can confirm that you get the line break copied after triple click, but no extra space.</p>
</blockquote>
<p dir="auto">If the original line ends with a space character, triple-clicking <em>would</em> get this space in the selection.</p>
<hr />
<blockquote>
<p dir="auto">How to just copy it without spaces and break line?</p>
</blockquote>
<p dir="auto">Steps:</p>
<ul>
<li>do the triple click</li>
<li>press Shift+leftarrow</li>
<li>press Ctrl+c</li>
</ul>
]]></description><link>https://community.notepad-plus-plus.org/post/79176</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/79176</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Tue, 16 Aug 2022 12:06:41 GMT</pubDate></item><item><title><![CDATA[Reply to remove Space &amp; Break line while Copying a line in notepad++ on Tue, 16 Aug 2022 10:57:16 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sultan" aria-label="Profile: Sultan">@<bdi>Sultan</bdi></a><br />
I can confirm that you get the line break copied after triple click, but no extra space.</p>
<p dir="auto">I would just do copying by using the keyboard:<br />
place the cursor at the begin of the line [Pos1, if necessary press it 2x], Shift + End,<br />
CTRL C, CTRL V</p>
]]></description><link>https://community.notepad-plus-plus.org/post/79174</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/79174</guid><dc:creator><![CDATA[kris 120]]></dc:creator><pubDate>Tue, 16 Aug 2022 10:57:16 GMT</pubDate></item></channel></rss>