Do not add diagnostics for any selection in the diagnostics panel

This commit is contained in:
Kirill Bulatov 2023-11-10 13:35:58 +02:00
parent 2f3044a2da
commit d38a2b793e
2 changed files with 4 additions and 5 deletions

View file

@ -171,10 +171,9 @@ impl ProjectDiagnosticsEditor {
.entry(*language_server_id)
.or_default()
.insert(path.clone());
let no_multiselections = this.editor.update(cx, |editor, cx| {
editor.selections.all::<usize>(cx).len() <= 1
});
if no_multiselections && !this.is_dirty(cx) {
if this.editor.read(cx).selections.all::<usize>(cx).is_empty()
&& !this.is_dirty(cx)
{
this.update_excerpts(Some(*language_server_id), cx);
}
}