FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Final touches to fix #2755 · GoToLoop/processing@4a3b082 · GitHub

Repository navigation

Commit 4a3b082

Browse files
committed
Final touches to fix processing#2755
1 parent 617f7db commit 4a3b082

2 files changed

Lines changed: 16 additions & 3 deletions

File tree

‎pdex/src/processing/mode/experimental/CompletionPanel.java‎

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
import javax.swing.ListSelectionModel;
4444
import javax.swing.Painter;
4545
import javax.swing.SwingUtilities;
46+
import javax.swing.SwingWorker;
4647
import javax.swing.UIDefaults;
4748
import javax.swing.UIManager;
4849
import javax.swing.plaf.InsetsUIResource;
@@ -326,12 +327,12 @@ public boolean insertSelection(int completionSource) {
326327
}
327328
}
328329

330+
boolean mouseClickOnOverloadedMethods = false;
329331
if (completionSource == MOUSE_COMPLETION) {
330332
// The case of overloaded methods, displayed as 'foo(...)'
331333
// They have completion strings as 'foo('. See #2755
332334
if (completionString.endsWith("(")) {
333-
completionString = completionString.substring(0, completionString
334-
.length() - 1);
335+
mouseClickOnOverloadedMethods = true;
335336
}
336337
}
337338

@@ -365,6 +366,18 @@ public boolean insertSelection(int completionSource) {
365366
} else {
366367
hide();
367368
}
369+
370+
if(mouseClickOnOverloadedMethods) {
371+
// See #2755
372+
SwingWorker<Object, Object> worker = new SwingWorker<Object, Object>() {
373+
protected Object doInBackground() throws Exception {
374+
editor.ta.fetchPhrase(null);
375+
return null;
376+
}
377+
};
378+
worker.execute();
379+
}
380+
368381
return true;
369382
} catch (BadLocationException e1) {
370383
e1.printStackTrace();

‎pdex/src/processing/mode/experimental/TextArea.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ else if (s.length() == 0)
360360
* @param evt - the KeyEvent which triggered this method
361361
* @return
362362
*/
363-
private String fetchPhrase(KeyEvent evt) {
363+
public String fetchPhrase(KeyEvent evt) {
364364

365365
int off = getCaretPosition();
366366
log2("off " + off);

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL