mirror of
https://github.com/processing/processing4.git
synced 2026-02-13 18:35:37 +01:00
add source option for CC insert
This commit is contained in:
@@ -86,6 +86,8 @@ public class CompletionPanel {
|
||||
private JScrollPane scrollPane;
|
||||
|
||||
protected DebugEditor editor;
|
||||
|
||||
public static final int MOUSE_COMPLETION = 10, KEYBOARD_COMPLETION = 20;
|
||||
|
||||
/**
|
||||
* Triggers the completion popup
|
||||
@@ -254,7 +256,7 @@ public class CompletionPanel {
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
if (e.getClickCount() == 2) {
|
||||
insertSelection();
|
||||
insertSelection(MOUSE_COMPLETION);
|
||||
hide();
|
||||
}
|
||||
}
|
||||
@@ -296,7 +298,7 @@ public class CompletionPanel {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean insertSelection() {
|
||||
public boolean insertSelection(int completionSource) {
|
||||
if (completionList.getSelectedValue() != null) {
|
||||
try {
|
||||
// If user types 'abc.', subword becomes '.' and null is returned
|
||||
@@ -324,6 +326,13 @@ public class CompletionPanel {
|
||||
}
|
||||
}
|
||||
|
||||
if (completionSource == MOUSE_COMPLETION) {
|
||||
if (completionString.endsWith("(")) {
|
||||
completionString = completionString.substring(0, completionString
|
||||
.length() - 2);
|
||||
}
|
||||
}
|
||||
|
||||
logE(subWord + " <= subword, Inserting suggestion=> "
|
||||
+ selectedSuggestion + " Current sub: " + currentSubword);
|
||||
if (currentSubword.length() > 0) {
|
||||
|
||||
Reference in New Issue
Block a user