Fix panic when multi-cursor edit attempted in deleted hunk (#23633)

Release Notes:

- N/A
This commit is contained in:
Conrad Irwin 2025-01-24 16:14:19 -07:00 committed by GitHub
parent ba16b4eb65
commit b7c6ffa6c2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 48 additions and 3 deletions

View file

@ -3724,6 +3724,9 @@ impl Editor {
}
let position = self.selections.newest_anchor().head();
if position.diff_base_anchor.is_some() {
return;
}
let (buffer, buffer_position) =
if let Some(output) = self.buffer.read(cx).text_anchor_for_position(position, cx) {
output
@ -4391,6 +4394,9 @@ impl Editor {
fn refresh_code_actions(&mut self, cx: &mut ViewContext<Self>) -> Option<()> {
let buffer = self.buffer.read(cx);
let newest_selection = self.selections.newest_anchor().clone();
if newest_selection.head().diff_base_anchor.is_some() {
return None;
}
let (start_buffer, start) = buffer.text_anchor_for_position(newest_selection.start, cx)?;
let (end_buffer, end) = buffer.text_anchor_for_position(newest_selection.end, cx)?;
if start_buffer != end_buffer {