1
0
Fork 0
mirror of https://github.com/helix-editor/helix synced 2024-05-21 04:06:06 +02:00

Fix crash on lsp text edits with invalid ranges (#9649)

This commit is contained in:
Eduardo Farinati 2024-04-05 23:17:22 -03:00 committed by GitHub
parent 1ba5763a0c
commit d3bfa3e063
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -539,6 +539,16 @@ pub fn generate_transaction_from_edits(
} else { } else {
return (0, 0, None); return (0, 0, None);
}; };
if start > end {
log::error!(
"Invalid LSP text edit start {:?} > end {:?}, discarding",
start,
end
);
return (0, 0, None);
}
(start, end, replacement) (start, end, replacement)
}), }),
) )