mirror of
https://github.com/zed-industries/zed.git
synced 2026-11-19 06:59:22 +01:00
52b0e43064
Closes #64446 ## Summary On Linux, each local selection change copies the selected text to the primary selection and joins multiple selections with newlines. It skipped the write only when the joined text was empty. With two or more cursors and nothing selected, the text is one newline per extra cursor, so every cursor move or keystroke replaced the primary selection with newlines. It now skips the write when every selection is empty. ## Testing `cargo test -p editor --lib` passes on Linux. `test_empty_selections_keep_primary_selection` is new, compiled only on Linux and FreeBSD, and fails without the fix. ## Self-review - [x] I've reviewed my diff for quality, security, reliability, and performance. - [x] UI changes follow the [checklist](https://zed.dev/docs/development/ui-checklist). - [x] Tests cover the new or changed behavior. Release Notes: - Fixed multiple cursors overwriting the primary selection with newlines on Linux