Author Topic: Pasting with Multiple cursors  (Read 1039 times)

jporkkahtc

  • Senior Community Member
  • Posts: 2620
  • Hero Points: 210
  • Text
Pasting with Multiple cursors
« on: May 02, 2022, 07:13:20 PM »
When the clipboard doesn't match the number of cursors on paste, the results are not very useful and can be really confusing.
If the clipboard contains a non-multiple cursor selection, then the paste simple repeats the paste for each cursor.
When the cursors are widely spaced, the results can be understood, but when they are close together the pasted blocks overlap and the results are really weird.

#1: A block selection whose # of lines matches the number of cursors on paste should paste one line at each cursor. (Behave like a multicursor copy would have).
#2: Warn when a Paste operation on multiple cursors causes overlap. The results are so complex that noone but clark would be planning to get this result.
(Does this only happen on multi-line clipboards?)

Also I found that:
#3: C-Home, C-End only moves one cursor. (top-of-buffer, bottom-of-buffer).
These should probably clear multi-cursor mode since the remaining cursors may not be visible and produce very unexpected results.

#4: Multiple cursors should be indicated in the mark-margin (the margin on the right) - as flashing blocks.


Example: Copy a 2x3 block of text, then attempt to paste when there are 3 cursors.
1 Select Block.
2 Select a 2 wide, 3 high block of text and copy.
3 From this block:
Code: [Select]
A123
B456
C789
What is copied:
Code: [Select]
A1
B4
C7

4 Setup 3 cursors on 3 blank lines.
5 Paste, and get:
Code: [Select]
A1
A1B4
A1B4C7
B4C7
C7
6 That is not a very intuitive result.
7 To better understand what happened...
8 Get 3 cursors again
9 Move to a blank space in the file
10 Hit enter a 3 times to add blank lines between cursors
11 Paste, Result:
Code: [Select]
A1
B4
C7

A1
B4
C7

A1
B4
C7