IDEA-60682 user live template requires two presses of the expansion key in some cases

This commit is contained in:
peter
2013-05-29 14:36:34 +02:00
parent 060595a26f
commit c9314095fa
2 changed files with 11 additions and 3 deletions
@@ -540,4 +540,15 @@ class Foo {
}
}
public void "test expand current live template on no suggestions in lookup"() {
myFixture.configureByText "a.java", "class Foo {{ <caret> }}"
myFixture.completeBasic()
assert myFixture.lookup
myFixture.type("sout")
assert myFixture.lookup
assert myFixture.lookupElementStrings == []
myFixture.type('\t')
myFixture.checkResult "class Foo {{\n System.out.println(<caret>); }}"
}
}
@@ -84,9 +84,6 @@ public abstract class ChooseItemAction extends EditorAction {
return false;
}
if (finishingChar == Lookup.REPLACE_SELECT_CHAR) {
if (lookup.isFocused()) {
return true;
}
return !lookup.getItems().isEmpty();
}