mirror of
https://github.com/zed-industries/zed.git
synced 2024-10-25 07:55:56 +00:00
Refresh document highlight after rename, but not during
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
This commit is contained in:
parent
c35a96c425
commit
4f086b8d7a
1 changed files with 13 additions and 4 deletions
|
@ -2409,6 +2409,10 @@ impl Editor {
|
|||
}
|
||||
|
||||
fn refresh_document_highlights(&mut self, cx: &mut ViewContext<Self>) -> Option<()> {
|
||||
if self.pending_rename.is_some() {
|
||||
return None;
|
||||
}
|
||||
|
||||
let project = self.project.as_ref()?;
|
||||
let buffer = self.buffer.read(cx);
|
||||
let newest_selection = self.newest_anchor_selection().clone();
|
||||
|
@ -4533,16 +4537,21 @@ impl Editor {
|
|||
)
|
||||
});
|
||||
|
||||
Some(cx.spawn(|workspace, cx| async move {
|
||||
Some(cx.spawn(|workspace, mut cx| async move {
|
||||
let project_transaction = rename.await?;
|
||||
Self::open_project_transaction(
|
||||
editor,
|
||||
editor.clone(),
|
||||
workspace,
|
||||
project_transaction,
|
||||
format!("Rename: {} → {}", old_name, new_name),
|
||||
cx,
|
||||
cx.clone(),
|
||||
)
|
||||
.await
|
||||
.await?;
|
||||
|
||||
editor.update(&mut cx, |editor, cx| {
|
||||
editor.refresh_document_highlights(cx);
|
||||
});
|
||||
Ok(())
|
||||
}))
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue