refactor: evaluate enable_diagnostics first

pull/12203/head
Nikita Revenco 2024-12-09 15:55:43 +00:00
parent 4b5da9e667
commit 9bf3262152
2 changed files with 3 additions and 3 deletions

View File

@ -53,7 +53,7 @@
| `popup-border` | Draw border around `popup`, `menu`, `all`, or `none` | `none` |
| `indent-heuristic` | How the indentation for a newly inserted line is computed: `simple` just copies the indentation level from the previous line, `tree-sitter` computes the indentation based on the syntax tree and `hybrid` combines both approaches. If the chosen heuristic is not available, a different one will be used as a fallback (the fallback order being `hybrid` -> `tree-sitter` -> `simple`). | `hybrid`
| `jump-label-alphabet` | The characters that are used to generate two character jump labels. Characters at the start of the alphabet are used first. | `"abcdefghijklmnopqrstuvwxyz"`
| `enable-diagnostics` | Whether to show obtrusive diagnostics, such as inline diagnostics and overlay diagnostics | `true` |
| `enable-diagnostics` | Whether to show diagnostics, such as inline diagnostics and overlay diagnostics | `true` |
| `end-of-line-diagnostics` | Minimum severity of diagnostics to render at the end of the line. Set to `disable` to disable entirely. Refer to the setting about `inline-diagnostics` for more details | "disable"
| `clipboard-provider` | Which API to use for clipboard interaction. One of `pasteboard` (MacOS), `wayland`, `x-clip`, `x-sel`, `win-32-yank`, `termux`, `tmux`, `windows`, `termcode`, `none`, or a custom command set. | Platform and environment specific. |

View File

@ -233,9 +233,9 @@ impl EditorView {
}
}
if config.inline_diagnostics.disabled()
if config.enable_diagnostics
&& config.inline_diagnostics.disabled()
&& config.end_of_line_diagnostics == DiagnosticFilter::Disable
&& config.enable_diagnostics
{
Self::render_diagnostics(doc, view, inner, surface, theme);
}