-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
While writing the paste functionality for the multi-cursor addition, I was focused on ensuring it was possible essentially to paste one line each cursor from the clipboard. For handling a mismatch in the number of lines and the number of cursors, I chose to use the smaller of the two either not pasting anything for extra cursors beyond the number of lines in the clipboard, or not pasting all the lines from the clipboard if there are not enough cursors.
I can see some limited examples of wanting that behavior, however it was pointed out that perhaps it should instead fall back to pasting the entire clipboard for each cursor in the case of a mismatch. (VSCode does this, and IMHO is a fine benchmark for implementation)
The implementation is quite simple:
change:
if len(lines) == 1:
lines = itertools.repeat(lines[0])to
if len(lines) != len(cursors):
lines = itertools.repeat(clip_text)within MultiCursorMixin.multi_cursor_paste
I would like some input however before posting it as a PR.