-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Description
Summary
After copying entire lines (i.e. without selection) with multiple cursors, pasting with a different number of cursors adds extra newlines between the pasted lines.
Description
As noted by @notpeter in #34797 (comment) (emphasis mine):
Multicursor cut/copy in vscode does not use this alternate line-wise paste mode and pastes to the cursor position(s) like a normal clipboard action. Multicursor in Jetbrains and Sublime have an odd behavior -- when cut/copying two adjacent lines if you paste to a single cursor you will get an extra line break between the pasted lines. (this makes cut/paste non-symmetrical). If pasting two lines to two cursors, Sublime will give you four lines separated by two linebreaks each; jetbrains will give you two lines seperated by two newlines each. I find all of these behaviors unintuitive.
Steps to reproduce:
- Place multiple (N > 1) cursors on separate lines
- Copy (without selecting any text, which copies entire lines)
- Paste using a different number of cursors (including just 1 cursor)
Expected Behavior: N lines are pasted at each cursor
Actual Behavior: 2N-1 lines are pasted at each cursor (the original N lines are interleaved with extra newlines)
Zed Version and System Specs
Zed: v0.209.4 (Zed)
OS: macOS 15.7.1
Memory: 16 GiB
Architecture: x86_64