mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-22 09:26:19 +04:00
Fix crash on lsp text edits with invalid ranges (#9649)
This commit is contained in:
parent
1ba5763a0c
commit
d3bfa3e063
@ -539,6 +539,16 @@ pub fn generate_transaction_from_edits(
|
||||
} else {
|
||||
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)
|
||||
}),
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user