Step 200: startup and performance improvements
This commit is contained in:
@@ -372,7 +372,8 @@ static void renderEditorPanel(EditorState& state) {
|
||||
state.symbolsPending = false;
|
||||
}
|
||||
|
||||
if (state.analysisPending && (now - state.analysisLastChange) > 0.5) {
|
||||
double diagDelay = state.settings.getDiagnosticsDebounceMs() / 1000.0;
|
||||
if (state.analysisPending && (now - state.analysisLastChange) > diagDelay) {
|
||||
if (state.isStructured()) {
|
||||
auto result = state.pipeline.run(state.active()->editBuf,
|
||||
state.active()->language,
|
||||
|
||||
@@ -381,6 +381,27 @@ static void renderSettingsPanel(EditorState& state) {
|
||||
settingsChanged = true;
|
||||
}
|
||||
|
||||
ImGui::Separator();
|
||||
ImGui::TextUnformatted("Debounce (ms)");
|
||||
int lspDebounce = state.settings.getLspDebounceMs();
|
||||
if (ImGui::InputInt("LSP Change", &lspDebounce)) {
|
||||
lspDebounce = std::max(0, lspDebounce);
|
||||
state.settings.setLspDebounceMs(lspDebounce);
|
||||
settingsChanged = true;
|
||||
}
|
||||
int diagDebounce = state.settings.getDiagnosticsDebounceMs();
|
||||
if (ImGui::InputInt("Diagnostics", &diagDebounce)) {
|
||||
diagDebounce = std::max(0, diagDebounce);
|
||||
state.settings.setDiagnosticsDebounceMs(diagDebounce);
|
||||
settingsChanged = true;
|
||||
}
|
||||
int highlightDebounce = state.settings.getHighlightDebounceMs();
|
||||
if (ImGui::InputInt("Highlighting", &highlightDebounce)) {
|
||||
highlightDebounce = std::max(0, highlightDebounce);
|
||||
state.settings.setHighlightDebounceMs(highlightDebounce);
|
||||
settingsChanged = true;
|
||||
}
|
||||
|
||||
LayoutPreset preset = state.ui.layoutPreset;
|
||||
int presetIndex = 0;
|
||||
if (preset == LayoutPreset::Emacs) presetIndex = 1;
|
||||
|
||||
Reference in New Issue
Block a user