-
Notifications
You must be signed in to change notification settings - Fork 4.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Copied lines are inserted in the wrong order #15151
Comments
I don't doubt you are seeing a definite bug here... However, I can't reproduce this in 8.6.7 following the steps-to-reproduce. When I try to reproduce (using guesswork because I don't know what you are doing with every action), I get: abc abc
def def
ghi ghi
jkl jkl
mno mno
pqr pqr |
Just a wild guess, but could this possibly be related to #15139 , which is explained in much greater detail? |
Yes, I assume that. He is explaining similar things. I will add detailed explanation when I have time to do that. Thank you for your responses |
If it is indeed similar to what you have reported in THIS issue, you may close THIS issue and add further detail to 15139 (it's no problem adding comments to someone else's issue). Or, if you feel it is not the same, thing, feel free to keep this issue open, as long as it is your intention truly to follow up and add more here. |
It is different to issue #15139 in that way that I do want to copy n lines and insert n lines (same number of lines). It is also not related to any tab switching. |
@juze92 Thanks for providing the images. The 1st image shows the primary caret at the bottom of the rectangular selection. The 2nd image has the primary caret at the top of the thin selection. Might be hard to notice as I had to zoom in to see it, though the primary caret is purple and the secondary carets are black. If you paste the rectangular selection as the 2nd image shows, it will place The primary caret needs to be syncronized to the same position of the top or the bottom to keep the same order. Primary caret at the top to copy and then primary caret at the top to paste will get the same order. To make this more obvious, I have set the primary caret and primary selection background to blue and the secondary caret and secondary background to yellow. I set the caret size to 3 pixels to make it more noticable.
The consequence with the desired order of using top down or bottom up is an important detail with rectangular selections. |
How did you reach the condition in the second image? Is the setting at Preferences | Editing 1 | Enable virtual space checked or unchecked? After you made the zero-width selection, but before you pasted, did the status bar show Recent versions of Notepad++ (following the underlying Scintilla control) have blurred the distinction between multiple selections and rectangular selections. For those of us used to using rectangular selections from when multiple selections were barely functional at all, some of the new behaviors seem incoherent. It’s tricky to keep track of what they are, because you have to look at the status bar to tell the difference between a rectangular selection and a multiple selection that just happens to line up straight. “Thin selections” confuse matters even further; they look like zero-width rectangular selections, but they do not show the rowsxcolumns characteristic of rectangular selections. They used to behave identically to zero-width rectangular selections, but I am not sure if that is still true. There is, as far as I can tell, no way for a user to tell the difference between a thin selection and an empty multiple selection in which all the cursors line up. You just have to know the exact sequence by which you got to where you were. In your example, I get to the same apparent position in different ways and get very different results on pasting. I do not think that should be how it works, but for now, it is. For example: Make the rectangular selection bottom to top and copy. With virtual space enabled, use the mouse to place the caret after the c, right arrow key twice, then hold Shift+Alt and down arrow to the bottom line. Looks like second screenshot. Paste. In order top to bottom, but no space. Make the rectangular selection bottom to top and copy. Use the mouse to place the caret after the c, type two spaces, then hold Shift+Alt and down arrow to the bottom line. Looks like second screenshot. Paste. In order top to bottom, but spaces are only in the first line. Make the rectangular selection bottom to top and copy. Use the mouse to place the caret after the c, hold Shift+Alt and down arrow to the bottom line, type two spaces. Looks like second screenshot. Paste. In order top to bottom, two spaces in every line. Make the rectangular selection bottom to top and copy. With virtual space enabled, use the right arrow key to move the cursor line two spaces to the right of the text. Looks like second screenshot. Paste. Comes out in reverse order, with no spaces. I don’t like any of this, but it might be “the new normal” for Notepad++. Enhancing multiple selections has thrown consistency for rectangular selections under the bus. :-( |
Related, another behavior change for rectangular selections: Start with:
(I have virtual space off, though I don’t think it matters.) Make a rectangular selection from before Place the cursor after In 8.5.8, blanks are inserted after In 8.6.7, the pasted content goes line by line to the end of the lines into which is was pasted, in reverse order. There are three cursors at the end of each line of the pasted content (so, different columns on each line), but the status bar still indicates a rectangular selection ( I fully admit to not understanding exactly what people expect of multiple selections. But having used rectangular selections through many years of Notepad++... this behavior is unpredictable and incoherent. I can’t even figure out what all has changed, or what the “new rules” are supposed to be. It’s just... all over the place. I should add one thing. As far as I can tell, if you select nothing — just put the caret where you want the top left of the pasted content to go and then paste — things still behave sanely. So there is a work-around: Don’t paste into rectangular selections, even zero-width ones, unless you enjoy surprises. |
@juze92 |
This is not identical to @juze92’s demonstration, but it’s the same behavior and, I think, less sensitive to exactly what settings you have:
Observe the difference in behavior between 8.6 or before and 8.6.4 or later (the exact point of change would have been whichever version introduced pasteIntoMultiSelection). Also notice (in post-8.6.4 versions) that the selection is not “rectangular” (the insert carets do not line up), yet the status bar indicates Sel : 6x0 = 0. Open another new tab, then switch back to this one, and you’ll have a rectangular selection that doesn’t quite make sense. |
@Coises |
Is there an existing issue for this?
Description of the Issue
I want to copy/paste a rectangular selection of columns and lines (with 'alt' key) and insert this selection after an existing text into the same number of lines. I want to preserve the table layout. This worked well in the past but is not functioning any more.
Problems:
The problems occur with version 8.6.7, 8.6.6, 8.6.4.
Version 8.5 works fine (I use this version until a fix of the problem).
Steps To Reproduce
E.g.: I want to add the content of the initial situation a second time, in the same lines and with two whitespaces in between.
Initial situation:
Current Behavior
Want I get:
Expected Behavior
What I want:
Debug Information
Anything else?
No response
The text was updated successfully, but these errors were encountered: