From 608422c84c025fbd6c533af0d3cbc5e63044701b Mon Sep 17 00:00:00 2001 From: Alexander Zolotov Date: Thu, 7 Apr 2016 15:19:07 +0300 Subject: [PATCH] finish template on Esc if completion lookup is open This reverts commit c071f03929b13bca4165cb176dbdb8f1c95b4d42. --- .../template/impl/editorActions/EscapeHandler.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/template/impl/editorActions/EscapeHandler.java b/platform/lang-impl/src/com/intellij/codeInsight/template/impl/editorActions/EscapeHandler.java index 58fac03b8d66..e24b60ee212f 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/template/impl/editorActions/EscapeHandler.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/template/impl/editorActions/EscapeHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2016 JetBrains s.r.o. + * Copyright 2000-2009 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,6 @@ package com.intellij.codeInsight.template.impl.editorActions; import com.intellij.codeInsight.CodeInsightBundle; -import com.intellij.codeInsight.lookup.LookupManager; import com.intellij.codeInsight.template.impl.TemplateManagerImpl; import com.intellij.codeInsight.template.impl.TemplateState; import com.intellij.openapi.actionSystem.DataContext; @@ -34,8 +33,7 @@ public class EscapeHandler extends EditorActionHandler { @Override public void execute(Editor editor, DataContext dataContext) { - //remove selection and closing lookup have higher precedence over finishing template editing - if (!editor.getSelectionModel().hasSelection() && LookupManager.getActiveLookup(editor) != null) { + if (!editor.getSelectionModel().hasSelection()) { //remove selection has higher precedence over finishing template editing final TemplateState templateState = TemplateManagerImpl.getTemplateState(editor); if (templateState != null && !templateState.isFinished()) { CommandProcessor.getInstance().setCurrentCommandName(CodeInsightBundle.message("finish.template.command"));