diff --git a/pdex/src/processing/mode/experimental/CompletionPanel.java b/pdex/src/processing/mode/experimental/CompletionPanel.java index 08fc06ac4..a7fd9bbc5 100644 --- a/pdex/src/processing/mode/experimental/CompletionPanel.java +++ b/pdex/src/processing/mode/experimental/CompletionPanel.java @@ -115,6 +115,7 @@ public class CompletionPanel { return list; } + // possibly defunct public boolean updateList(final DefaultListModel items, String newSubword, final Point location, int position) { this.subWord = new String(newSubword); diff --git a/pdex/src/processing/mode/experimental/TextArea.java b/pdex/src/processing/mode/experimental/TextArea.java index 3e2a36f28..8025f96b3 100644 --- a/pdex/src/processing/mode/experimental/TextArea.java +++ b/pdex/src/processing/mode/experimental/TextArea.java @@ -708,9 +708,9 @@ public class TextArea extends JEditTextArea { } protected void showSuggestion(DefaultListModel defListModel,String subWord) { + hideSuggestion(); if (defListModel.size() == 0) { log("TextArea: No suggestions to show."); - hideSuggestion(); return; } int position = getCaretPosition(); @@ -729,13 +729,13 @@ public class TextArea extends JEditTextArea { if (subWord.length() < 2) { return; } - if (suggestion == null) - suggestion = new CompletionPanel(this, position, subWord, defListModel, - location,editor); - else - suggestion.updateList(defListModel, subWord, location, position); - - suggestion.setVisible(true); + //if (suggestion == null) + suggestion = new CompletionPanel(this, position, subWord, defListModel, + location,editor); +// else +// suggestion.updateList(defListModel, subWord, location, position); +// +// suggestion.setVisible(true); requestFocusInWindow(); // SwingUtilities.invokeLater(new Runnable() { // @Override @@ -748,6 +748,7 @@ public class TextArea extends JEditTextArea { protected void hideSuggestion() { if (suggestion != null) { suggestion.hide(); + log("Suggestion hidden."); suggestion = null; } }