From 59d0e3d76a6af11b59eced42f9227ebd9d3bd4b9 Mon Sep 17 00:00:00 2001 From: Curtis Rueden Date: Wed, 11 Dec 2024 14:38:11 -0600 Subject: [PATCH] WIP: Apply autocompletion settings more aggressively Unfortunately, it doesn't seem to actually address the over-eager autocompletion popping up without hotkey press, even when the Script Editor settings are configured to want otherwise. More investigation needed. --- src/main/java/org/scijava/ui/swing/script/EditorPane.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/org/scijava/ui/swing/script/EditorPane.java b/src/main/java/org/scijava/ui/swing/script/EditorPane.java index 9eb2abcc..7f4690d1 100644 --- a/src/main/java/org/scijava/ui/swing/script/EditorPane.java +++ b/src/main/java/org/scijava/ui/swing/script/EditorPane.java @@ -781,9 +781,15 @@ protected void setLanguage(final ScriptLanguage language, supportLevel = "N/A. Using Java as fallback"; } if (support != null) { + // NB: We call support.set*Enabled functions both before and after + // installing the LanguageSupport, to increase the chances of + // LanguageSupport implementations getting configured according to + // the user's wishes, rather than with hardcoded defaults. support.setAutoCompleteEnabled(autoCompletionEnabled); support.setAutoActivationEnabled(autoCompletionWithoutKey); support.install(this); + support.setAutoCompleteEnabled(autoCompletionEnabled); + support.setAutoActivationEnabled(autoCompletionWithoutKey); if (!autoCompletionEnabled) supportLevel += " but currently disabled\n"; else {