Skip to content

Commit 3cd4eef

Browse files
Do not add diagnostics for any selection in the diagnostics panel (#3300)
Make the panel less jumpy by deferring diagnostics updates until cmd-s is pressed, if any caret is placed inside the diagnostics panel. Release Notes: - N/A
2 parents 2f3044a + d38a2b7 commit 3cd4eef

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

assets/settings/default.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@
209209
"ensure_final_newline_on_save": true,
210210
// Whether or not to perform a buffer format before saving
211211
"format_on_save": "on",
212-
// How to perform a buffer format. This setting can take two values:
212+
// How to perform a buffer format. This setting can take 4 values:
213213
//
214214
// 1. Format code using the current language server:
215215
// "formatter": "language_server"

crates/diagnostics/src/diagnostics.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,9 @@ impl ProjectDiagnosticsEditor {
171171
.entry(*language_server_id)
172172
.or_default()
173173
.insert(path.clone());
174-
let no_multiselections = this.editor.update(cx, |editor, cx| {
175-
editor.selections.all::<usize>(cx).len() <= 1
176-
});
177-
if no_multiselections && !this.is_dirty(cx) {
174+
if this.editor.read(cx).selections.all::<usize>(cx).is_empty()
175+
&& !this.is_dirty(cx)
176+
{
178177
this.update_excerpts(Some(*language_server_id), cx);
179178
}
180179
}

0 commit comments

Comments
 (0)