mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
DBE: do not add space on ,; chars completions IDEA-153825
This commit is contained in:
+8
-1
@@ -15,15 +15,22 @@ public class AddSpaceInsertHandler implements InsertHandler<LookupElement> {
|
||||
public final static InsertHandler<LookupElement> INSTANCE = new AddSpaceInsertHandler(false);
|
||||
public final static InsertHandler<LookupElement> INSTANCE_WITH_AUTO_POPUP = new AddSpaceInsertHandler(true);
|
||||
|
||||
private final String myIgnoreOnChars;
|
||||
private final boolean myTriggerAutoPopup;
|
||||
|
||||
public AddSpaceInsertHandler(boolean triggerAutoPopup) {
|
||||
this("", triggerAutoPopup);
|
||||
}
|
||||
|
||||
public AddSpaceInsertHandler(String ignoreOnChars, boolean triggerAutoPopup) {
|
||||
myIgnoreOnChars = ignoreOnChars;
|
||||
myTriggerAutoPopup = triggerAutoPopup;
|
||||
}
|
||||
|
||||
public void handleInsert(InsertionContext context, LookupElement item) {
|
||||
Editor editor = context.getEditor();
|
||||
if (context.getCompletionChar() == ' ') return;
|
||||
char completionChar = context.getCompletionChar();
|
||||
if (completionChar == ' ' || myIgnoreOnChars.indexOf(completionChar) >= 0) return;
|
||||
Project project = editor.getProject();
|
||||
if (project != null) {
|
||||
if (!isCharAtSpace(editor)) {
|
||||
|
||||
Reference in New Issue
Block a user