mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
let Complete Statement action first finish the live template if any (IDEA-128090)
This commit is contained in:
+7
@@ -18,6 +18,8 @@ package com.intellij.codeInsight.editorActions.smartEnter;
|
||||
|
||||
import com.intellij.codeInsight.editorActions.enter.EnterAfterUnmatchedBraceHandler;
|
||||
import com.intellij.codeInsight.lookup.LookupManager;
|
||||
import com.intellij.codeInsight.template.impl.TemplateManagerImpl;
|
||||
import com.intellij.codeInsight.template.impl.TemplateState;
|
||||
import com.intellij.lang.Language;
|
||||
import com.intellij.openapi.actionSystem.CommonDataKeys;
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
@@ -64,6 +66,11 @@ public class SmartEnterAction extends EditorAction {
|
||||
|
||||
LookupManager.getInstance(project).hideActiveLookup();
|
||||
|
||||
TemplateState state = TemplateManagerImpl.getTemplateState(editor);
|
||||
if (state != null) {
|
||||
state.gotoEnd();
|
||||
}
|
||||
|
||||
final int caretOffset = editor.getCaretModel().getOffset();
|
||||
|
||||
PsiFile psiFile = PsiUtilBase.getPsiFileInEditor(editor, project);
|
||||
|
||||
Reference in New Issue
Block a user