Fix panic when multi-cursor edit attempted in deleted hunk (#23633)
Release Notes: - N/A
This commit is contained in:
parent
ba16b4eb65
commit
b7c6ffa6c2
4 changed files with 48 additions and 3 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue