Sublime Forum

Paste with multi cursor someohow changed

#1

given the following code

blah1
blah2
blah3

xyz1
xyz2
xyz3

which I wish to combine horizontally. i right click drag and mark the upper block giving one cursor per line and hit control c or x then hit escape to go back to just one cursor.

i then click drag the second block creating multiple cursors there, hit end and hit paste.

Previously i would end up with

xyz1 blah1
xyz2 blah2
xyz3 blah3

but now i get
xyz1 blah1
blah2
blah3
xyz2 blah1
blah2
blah3
xyz3 blah1
blah2
blah3

what am I doing wrong?

0 Likes

#2

Without seeing screenshots of how exactly you’re doing the selections it’s hard to say with authority, but something to keep in mind is that the total number of lines of text copied needs to match the total number of cursors/selections you’re pasting into; if there’s s a mismatch, the whole paste goes everywhere.

In particular, be wary of a selection that spans a line, since that would include the newline in the copy and make the cursor count go up when you don’t expect it.

For example, easy to accidentally select a line of text like this:

image

Instead of like this:

image

Essentially, the clipboard text is split on newlines and each line gets pasted to a cursor; in the first example, that leaves 2 “lines”, one that has the text, then an empty one.

0 Likes