drag it out and drop as a copy
-
Hello!
While editing a text file, it’s possible to copy a selected text into a new place in the same file. For that, one has to push Ctrl button while D&Ding. Unfortunately, that does not work with dropping a selection outside the notepad++
So, is there a way to use D&D feature to drag and drop a selected text out of the editor while keeping the original selection in place? -
-
@Alan-Kilborn sure, that will work, just like right click + Copy\Paste, but my question is on why Notepad++ is different is this regard from, say Microsoft Word? In the Word D&D between the latter and some other text field leaves the selected text in its original place.
-
I think this depends on the app into which you drag and drop.
For example, I just opened a text file in Notepad++ and also opened a Reddit New Post window in Firefox and selected Markdown mode.
If I drag selected text from Notepad++ to the post text box, it is moved. If I Crtl+drag, it is copied.
When I switch to the Reddit Fancy Pants editor, the data is still deleted if I drag and unchanged if I Ctrl+drag, but nothing get pasted either way. (Probably a Reddit and/or Firefox bug.)
If I use a Windows Run command dialog (Win+r) as the target, the data gets copied, but not deleted, regardless of whether I drag or Ctrl+drag. If the data contains blanks, quotes are added around the copy in the dialog.
I don’t recall the details, but my memory says the control onto which you drop is responsible for most of what happens when you drag and drop. Notepad++ appears to be doing its part.
-
@Nick-Kat said in drag it out and drop as a copy:
Hello!
While editing a text file, it’s possible to copy a selected text into a new place in the same file. For that, one has to push Ctrl button while D&Ding. Unfortunately, that does not work with dropping a selection outside the notepad++
So, is there a way to use D&D feature to drag and drop a selected text out of the editor while keeping the original selection in place?I think you need provide more information as I can’t reproduce the issue.
I’m on Windows11 and I tested drag-n-drop from Notepad++ v8.5.7 (both 64 and 32-bit mode) to Microsoft Word 2010, Microsoft Notepad app thing, and Firefox and it worked as expected. If I don’t hold the Ctrl key down it moves the text from Notepad++ into the destination. If I hold the Ctrl key down when doing the drag-n-drop then it copies the selected text into the destination and the original text remains in Notepad++.
I discovered I can’t drag-and-drop from Notepad++ into this forum’s message reply box. What I tried that a message showed up on the forum side with “Drag and Drop Images Here” but when I let go my text did not get dropped. I guess the message board only allows images, but not text, to get dropped in.
-
- Select text
- Drag the selected text to the position you want to drop
- Press Ctrl and release mouse button
- Done