Issues with copy/paste on v8.6
-
I recently moved from version v8.5.8 to version v8.6 (I also moved from Windows 10 to Windows 11 (company mandate)) and noticed two issues with copy/paste. These issues recurred even after reverting back to default settings by deleting the Notepad++ folder in my Roaming folder.
Issue 1). I’ll copy a string of text from Notepad++ to another line within the same document, or to another Notepad++ document, or to another program entirely, and there will be a CR/LF inserted before the string I’ve copied.
Example, I’ll copy “text2”, which has no CR/LF before it, and paste it to the start of line 6, and it will be pasted to line 7 instead, with a CR/LF on line 6.
It will also occur regardless of where I paste to, in the below example it’ll paste it directly below where my cursor was when pasting.This issue occurs maybe every 2nd or 3rd copy/paste attempt.
Issue 2) This one is much more difficult to reproduce. But I’ve noticed that occasionally when I copy/paste, I’ll end up pasting in the previous two separate strings I had highlighted as well. I don’t know how this is occurring, because I don’t know how to intentionally highlight separate strings of text that are in different areas of a document.
Example, I intentionally highlighted “P258678P” and pasted it elsewhere, to notice that “working” and “P258678P” were highlighted and copied as well.
First time posting here and I don’t know if this is a bug or a feature that requires me to change a certain setting in order to revert back to previous expected behavior.
-
@Rory-Jakobs said in Issues with copy/paste on v8.6:
I don’t know how to intentionally highlight separate strings of text that are in different areas of a document.
That happens if something is selected, then you hold the Ctrl key while using the mouse to drag-select something else.
Before 8.6, you had to explicitly enable that behavior at Settings | Preferences… | Editing | Enable Multi-Editing (Ctrl+Mouse click/selection). That setting was removed in 8.6; multiple selection is now always available.
(If you Ctrl+drag when nothing was selected, you’ll still get two selections — an empty one where the caret was, followed by the new drag selection. That would explain the unexpected extra line in your first issue.)
I can’t imagine you’re just randomly holding down the Ctrl key for no reason… but I suspect something is causing it to register as held down. Can you think of any special circumstances that might cause that?
-
@Coises Hi, thanks for replying. I can confirm that Ctrl+drag (or Ctrl+double click to highlight) does the multi-highlight behavior, so it appears this occurs because I’m holding the Ctrl key (in preparation to press “C” or “V”). That answers issue 2.
Regarding issue 1)
I realized that if you hold Ctrl while dragging to highlight a word (even if it’s the first word of the document, and you haven’t highlighted anything else), then copy it, it will add a CR/LF to the pasted text (regardless of which application you paste it to) - not sure why anyone would want that, but good to know that’s the cause.So my habit of holding the Ctrl key has caused both these issues, when Multi-Editing became the default on v8.6.
“Before 8.6, you had to explicitly enable that behavior at Settings | Preferences… | Editing | Enable Multi-Editing (Ctrl+Mouse click/selection). That setting was removed in 8.6; multiple selection is now always available.”Is there any way to disable this feature? Or do I have to revert back to 8.5.8?
-
@Rory-Jakobs said in Issues with copy/paste on v8.6:
Is there any way to disable this feature?
To the best of my knowledge, there is no way to disable it built in to Notepad++ 8.6 (and presumably future versions). I believe a plugin could do it by executing SCI_SETMULTIPLESELECTION(false).
If someone familiar with one of the scripting plugins reads this, perhaps they could suggest an easy way to create something that would test whether that would work for you.
Or do I have to revert back to 8.5.8?
Or get out of the habit of holding down the Ctrl key while mousing?
-
@Rory-Jakobs said in Issues with copy/paste on v8.6:
I realized that if you hold Ctrl while dragging to highlight a word (even if it’s the first word of the document, and you haven’t highlighted anything else), then copy it, it will add a CR/LF to the pasted text
I can’t reproduce that behavior in 8.6.
-
@Alan-Kilborn said in Issues with copy/paste on v8.6:
@Rory-Jakobs said in Issues with copy/paste on v8.6:
I realized that if you hold Ctrl while dragging to highlight a word (even if it’s the first word of the document, and you haven’t highlighted anything else), then copy it, it will add a CR/LF to the pasted text
I can’t reproduce that behavior in 8.6.
FWIW, it seems to be inserting a down arrow and not a CRLF. Here’s a repro using a fresh portable 8.6.
abc def ghi jkl mno pqr stu vwx yz x1 x2 x3 x4 x5
- Hold the Ctrl key down and then click-drag any of the 3-letter sequences and then type C which will be a Ctrl+C as you have been holding the Ctrl key down.
- Release the Ctrl key and using the mouse click just after the 3 in
x3
to position the cursor there. - Do Ctrl-V to paste and the 3-letter sequence will be at the end of the
x4
line.
What’s happening is that when we held the Ctrl key down and then click-dragged that we were creating a second selection of a multi-select. The first one is zero width and captures the cursor position before we started the test.
You get the same results if you hold the Ctrl key down and double click any of the 3-letter sequences to select it. It does not need to be a mouse drag.
It seems to be a down-arrow because if you test by pasting between the
x
and3
then the paste shows up between thex
and4
.In the past, holding the Ctrl key down like this was a non-issue as multi-select was disabled by default. Prior to to npp 8.6 you could to that test above while holding the key down the entire time. Ctrl-C will copy the selected letters and the Ctrl-V will paste the text exactly where you clicked within the x# rows.
If you have been used to holding the Ctrl key down in preparation for a Ctrl+C or Ctrl-V then I suspect it’s very difficult to unlearn it. If you ask me how do things in various editors I have used in the past 50+ years then I’ll say I don’t know but sit me down in front of an ASR-33 teletype, Hazeltine 2000 terminal (with core memory meaning you did not loose your stuff when the power went out, woo hoo!), ADM-3A, etc. then my fingers, including that left pinky on Ctrl, know exactly what to do.
-
@mkupper said in Issues with copy/paste on v8.6:
Hold the Ctrl key down and then click-drag any of the 3-letter sequences and then type C which will be a Ctrl+C as you have been holding the Ctrl key down.
Release the Ctrl key and using the mouse click just after the 3 in x3 to position the cursor there.
Do Ctrl-V to paste and the 3-letter sequence will be at the end of the x4 line.At first I couldn’t repro.
Then I added a pre-step: Press Ctrl+Home to get a single caret at start-of-file.
And I could repro it.When copying multi-selections, it appears you obtain line-endings between the selections. If you have one that is empty, you still get that line-ending. That seems to be what is happening in the example.
I don’t know that line-endings make sense in this situation. When you select something (without selecting a line-ending into it) and copy it, you expect to obtain exactly what you selected.
On the other hand, without the line-endings, all of the copied text selections runs together (e.g., multi-selection in 8.5.8), so I’m not sure that is the best either.
-
@mkupper said in Issues with copy/paste on v8.6:
If you have been used to holding the Ctrl key down in preparation for a Ctrl+C or Ctrl-V then I suspect it’s very difficult to unlearn it.
When new features are added to software, you have to learn how to use them. Sometimes that involves some unlearning, and yes, that may be difficult. But, in theory, at the end, you are in a better place.
But with all the bugs with this new feature, we are seemingly far from that “better place”. Hopefully it can all be sorted out and fixed (multi-select mode coexisting alongside column-block-select mode), and hopefully the N++ developer has interest in doing so.