Document why join_lines has a special case for single-line selections (#20528)

Release Notes:

- N/A
This commit is contained in:
Michael Sloan 2024-11-11 21:28:26 -07:00 committed by GitHub
parent b08ac2ae3e
commit 2521ef7bc4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -6313,6 +6313,8 @@ impl Editor {
let mut row_ranges = Vec::<Range<MultiBufferRow>>::new();
for selection in self.selections.all::<Point>(cx) {
let start = MultiBufferRow(selection.start.row);
// Treat single line selections as if they include the next line. Otherwise this action
// would do nothing for single line selections individual cursors.
let end = if selection.start.row == selection.end.row {
MultiBufferRow(selection.start.row + 1)
} else {