<?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[Click link and paste new link]]></title><description><![CDATA[<p dir="auto">When you click a link and right click you can copy the link. Why can’t you paste a new link over it?</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/24893/click-link-and-paste-new-link</link><generator>RSS for Node</generator><lastBuildDate>Wed, 17 Jun 2026 14:44:29 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/24893.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 07 Sep 2023 12:46:55 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Click link and paste new link on Fri, 15 Sep 2023 11:42:16 GMT]]></title><description><![CDATA[<p dir="auto">This behavior is easy to write a script for, and as scripts can be configured to run from the editor’s right-click menu, a script solution seems to “check all the boxes”.</p>
<p dir="auto">Here’s <code>UrlLinkSelectOrPasteover.py</code>:</p>
<pre><code class="language-py"># -*- coding: utf-8 -*-
from __future__ import print_function

#########################################
#
#  UrlLinkSelectOrPasteover (ULSOP)
#
#########################################

# references:
#  https://community.notepad-plus-plus.org/topic/24893/click-link-and-paste-new-link
#  https://github.com/notepad-plus-plus/notepad-plus-plus/issues/14114
#  for newbie info on PythonScripts, see https://community.notepad-plus-plus.org/topic/23039/faq-desk-how-to-install-and-run-a-script-in-pythonscript

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

from Npp import *

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

class ULSOP(object):

    def __init__(self):

        URL_INDIC = 8
        curr_pos = editor.getCurrentPos()
        pasting = False
        if editor.indicatorValueAt(URL_INDIC, curr_pos):
            editor.setSel(editor.indicatorStart(URL_INDIC, curr_pos), editor.indicatorEnd(URL_INDIC, curr_pos))
            if pasting: editor.paste()

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

if __name__ == '__main__': ULSOP()
</code></pre>
<p dir="auto">If you want pasting behavior rather than selection behavior, change <code>pasting = False</code> to <code>pasting = True</code>.  If you want both behaviors (in, say, two context menu entries), then you’ll need a second script (virtually a copy of the first).</p>
]]></description><link>https://community.notepad-plus-plus.org/post/89257</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/89257</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Fri, 15 Sep 2023 11:42:16 GMT</pubDate></item><item><title><![CDATA[Reply to Click link and paste new link on Fri, 15 Sep 2023 07:48:04 GMT]]></title><description><![CDATA[<p dir="auto">Thanks mkupper</p>
]]></description><link>https://community.notepad-plus-plus.org/post/89256</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/89256</guid><dc:creator><![CDATA[agajjsjs]]></dc:creator><pubDate>Fri, 15 Sep 2023 07:48:04 GMT</pubDate></item><item><title><![CDATA[Reply to Click link and paste new link on Sat, 09 Sep 2023 18:50:57 GMT]]></title><description><![CDATA[<p dir="auto">Thanks mkupper</p>
]]></description><link>https://community.notepad-plus-plus.org/post/89167</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/89167</guid><dc:creator><![CDATA[2VNews]]></dc:creator><pubDate>Sat, 09 Sep 2023 18:50:57 GMT</pubDate></item><item><title><![CDATA[Reply to Click link and paste new link on Fri, 08 Sep 2023 16:09:57 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/2vnews" aria-label="Profile: 2VNews">@<bdi>2VNews</bdi></a> said in <a href="/post/89150">Click link and paste new link</a>:</p>
<blockquote>
<p dir="auto">the right click menu should also contain paste over link, instead of just copy link.</p>
</blockquote>
<p dir="auto">I have added a comment about this on github.<br />
<a href="https://github.com/notepad-plus-plus/notepad-plus-plus/issues/14114#issuecomment-1711911031" rel="nofollow ugc">https://github.com/notepad-plus-plus/notepad-plus-plus/issues/14114#issuecomment-1711911031</a></p>
]]></description><link>https://community.notepad-plus-plus.org/post/89154</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/89154</guid><dc:creator><![CDATA[mkupper]]></dc:creator><pubDate>Fri, 08 Sep 2023 16:09:57 GMT</pubDate></item><item><title><![CDATA[Reply to Click link and paste new link on Fri, 08 Sep 2023 04:32:36 GMT]]></title><description><![CDATA[<p dir="auto">the right click menu should also contain paste over link, instead of just copy link.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/89150</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/89150</guid><dc:creator><![CDATA[2VNews]]></dc:creator><pubDate>Fri, 08 Sep 2023 04:32:36 GMT</pubDate></item><item><title><![CDATA[Reply to Click link and paste new link on Thu, 07 Sep 2023 18:02:50 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> FYI, I looked at the code and the existing <code>Copy link</code> menu item will only appear if the current selection length is zero and and the cursor is within a link. If you select one or more characters within a link and then right-click the selection area then <code>Copy link</code> will not be available in the right-click menu.</p>
<p dir="auto">At present code that inserts <code>Copy link</code> into the menu dynamically replaces the <code>Copy</code> item (IDM_EDIT_COPY) that’s in the right click contact menu with <code>Copy link</code> (IDM_EDIT_COPY_LINK). The code that replaces a context menu item with a new one would now need to also add a new item to the list, presumably, below the item for <code>Copy link</code>. I don’t know if adding context items on the fly is easy.</p>
<p dir="auto">I’ll post a feature request for adding <code>Select link</code> as it seems like something that won’t create too much astonishment.</p>
<p dir="auto">The “Select link” feature request is at <a href="https://github.com/notepad-plus-plus/notepad-plus-plus/issues/14114" rel="nofollow ugc">https://github.com/notepad-plus-plus/notepad-plus-plus/issues/14114</a></p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/2vnews" aria-label="Profile: 2VNews">@<bdi>2VNews</bdi></a> seems to be asking for ‘Paste into link’ which is more challenging to add to the code and also creates decisions and possible astonishment or surprises. The decision is, would someone want Ctrl-V (paste) to automatically replace a link? If so, that’ll also need to be added to preferences. A related item is that ‘Paste into link’ will seem like clutter to many people. I suspect it should be turned off by default and enabled via config.xml and possible Preferences. Maybe it can be added as an Edit menu item and thus available for use by macros.  Someone desiring to use “Paste into link” could either add a new keyboard shortcut or redefine the <code>Ctrl-V</code> shortcut if desired. A still tricky aspect is that “Paste into link” is usually only available if the selection size is zero and the cursor is within an underlined link.</p>
<p dir="auto">I did not add a feature request for this aspect pending further clarification of what is desired.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/89139</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/89139</guid><dc:creator><![CDATA[mkupper]]></dc:creator><pubDate>Thu, 07 Sep 2023 18:02:50 GMT</pubDate></item><item><title><![CDATA[Reply to Click link and paste new link on Thu, 07 Sep 2023 16:09:18 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> said in <a href="/post/89131">Click link and paste new link</a>:</p>
<blockquote>
<p dir="auto">manually (use the mouse, use shift+arrow)</p>
</blockquote>
<p dir="auto">… but I do recognize how painful that could be, especially when you are in the middle of a long link with multiple path separators.</p>
<p dir="auto">If there were a <a href="https://community.notepad-plus-plus.org/topic/15741/faq-desk-feature-request-or-bug-report">feature request</a> submitted that requested a command be added to right click menu next to Copy Link, which would <em>select</em> the whole link (“Select Link”), I would upvote that feature request.</p>
<blockquote>
<p dir="auto">I would personally hate it if I could not paste into it</p>
</blockquote>
<p dir="auto">And thinking about it, I think I misunderstood the original request.  I originally thought that the request was that if you were on a link, hitting <strong>Edit&gt;Paste</strong>/<code>Ctrl+V</code> would paste overtop the whole link, which is what I would have “hated”.  But if the original request was really asking that there be a new context-menu entry for “paste over active link”, similar to my “Select Link” suggestion, then I <em>would</em> upvote that feature request.  Sorry for mis-understanding the original request and reacting too strongly.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/89134</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/89134</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Thu, 07 Sep 2023 16:09:18 GMT</pubDate></item><item><title><![CDATA[Reply to Click link and paste new link on Thu, 07 Sep 2023 15:30:01 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mkupper" aria-label="Profile: mkupper">@<bdi>mkupper</bdi></a> said in <a href="/post/89128">Click link and paste new link</a>:</p>
<blockquote>
<p dir="auto">How do you do that?</p>
</blockquote>
<p dir="auto">manually (use the mouse, use shift+arrow)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/89131</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/89131</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Thu, 07 Sep 2023 15:30:01 GMT</pubDate></item><item><title><![CDATA[Reply to Click link and paste new link on Thu, 07 Sep 2023 15:09:48 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> said in <a href="/post/89124">Click link and paste new link</a>:</p>
<blockquote>
<p dir="auto">– by first selecting the whole link –</p>
</blockquote>
<p dir="auto">How do you do that?  When the cursor is on a link I can right click and select “Copy link” but I don’t see “Select link” so that the OP could get what they desired by then pasting the replacement link content on top of the selected text, which is the link.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/89128</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/89128</guid><dc:creator><![CDATA[mkupper]]></dc:creator><pubDate>Thu, 07 Sep 2023 15:09:48 GMT</pubDate></item><item><title><![CDATA[Reply to Click link and paste new link on Thu, 07 Sep 2023 12:56:53 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/2vnews" aria-label="Profile: 2VNews">@<bdi>2VNews</bdi></a> ,</p>
<blockquote>
<p dir="auto">Why can’t you paste a new link over it?</p>
</blockquote>
<p dir="auto">Sometimes when I’m editing a file with links, I want to paste something <em>into</em> the URL; I would personally hate it if I could not paste into it, but instead it overwrote the whole link.  And the way it is written, it is always possible to paste over a link – by first selecting the whole link – whereas if it were implemented the way you wanted, when I clicked in the middle and hit paste, if it defaulted to pasting over the link, there wouldn’t be a way to accomplish <em>editing</em> rather than <em>overwriting</em> a link using paste.</p>
<p dir="auto">(This is just my opinion/interpretation.)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/89124</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/89124</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Thu, 07 Sep 2023 12:56:53 GMT</pubDate></item></channel></rss>