Skip to content
This repository was archived by the owner on Oct 4, 2019. It is now read-only.

Commit fa259b0

Browse files
committed
Completion list now always recreated, fixes #19
1 parent 54efc33 commit fa259b0

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

src/processing/mode/experimental/CompletionPanel.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ public void mouseClicked(MouseEvent e) {
115115
return list;
116116
}
117117

118+
// possibly defunct
118119
public boolean updateList(final DefaultListModel items, String newSubword,
119120
final Point location, int position) {
120121
this.subWord = new String(newSubword);

src/processing/mode/experimental/TextArea.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -708,9 +708,9 @@ public void run() {
708708
}
709709

710710
protected void showSuggestion(DefaultListModel defListModel,String subWord) {
711+
hideSuggestion();
711712
if (defListModel.size() == 0) {
712713
log("TextArea: No suggestions to show.");
713-
hideSuggestion();
714714
return;
715715
}
716716
int position = getCaretPosition();
@@ -729,13 +729,13 @@ protected void showSuggestion(DefaultListModel defListModel,String subWord) {
729729
if (subWord.length() < 2) {
730730
return;
731731
}
732-
if (suggestion == null)
733-
suggestion = new CompletionPanel(this, position, subWord, defListModel,
734-
location,editor);
735-
else
736-
suggestion.updateList(defListModel, subWord, location, position);
737-
738-
suggestion.setVisible(true);
732+
//if (suggestion == null)
733+
suggestion = new CompletionPanel(this, position, subWord, defListModel,
734+
location,editor);
735+
// else
736+
// suggestion.updateList(defListModel, subWord, location, position);
737+
//
738+
// suggestion.setVisible(true);
739739
requestFocusInWindow();
740740
// SwingUtilities.invokeLater(new Runnable() {
741741
// @Override
@@ -748,6 +748,7 @@ protected void showSuggestion(DefaultListModel defListModel,String subWord) {
748748
protected void hideSuggestion() {
749749
if (suggestion != null) {
750750
suggestion.hide();
751+
log("Suggestion hidden.");
751752
suggestion = null;
752753
}
753754
}

0 commit comments

Comments
 (0)