From d29b582d91f33113fe0d805af67dc8a6fcaceb41 Mon Sep 17 00:00:00 2001 From: peter Date: Mon, 12 Sep 2016 13:30:18 +0200 Subject: [PATCH] live template: when a lookup item is inserted so that the caret is in the next variable, move to that variable --- .../codeInsight/template/impl/TemplateState.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/template/impl/TemplateState.java b/platform/lang-impl/src/com/intellij/codeInsight/template/impl/TemplateState.java index 2eb9ba6712aa..2e9f250f12be 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/template/impl/TemplateState.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/template/impl/TemplateState.java @@ -122,8 +122,13 @@ public class TemplateState implements Disposable { myLookupListener = new LookupAdapter() { @Override public void itemSelected(LookupEvent event) { - if (isCaretOutsideCurrentSegment() && !isCaretInsideNextVariable()) { - gotoEnd(true); + if (isCaretOutsideCurrentSegment()) { + if (isCaretInsideNextVariable()) { + nextTab(); + } + else { + gotoEnd(true); + } } } };