From e3a525339b540b2e3997286eec85bb51133a2728 Mon Sep 17 00:00:00 2001 From: Alexander Zolotov Date: Mon, 10 Apr 2017 22:24:43 +0300 Subject: [PATCH] Do not close completion popup on `%` (WEB-26250) --- .../codeInsight/template/impl/LiveTemplateCharFilter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/template/impl/LiveTemplateCharFilter.java b/platform/lang-impl/src/com/intellij/codeInsight/template/impl/LiveTemplateCharFilter.java index 0a2fa55fed3e..95b9a2e54159 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/template/impl/LiveTemplateCharFilter.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/template/impl/LiveTemplateCharFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2017 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. @@ -28,7 +28,7 @@ public class LiveTemplateCharFilter extends CharFilter { public Result acceptChar(char c, int prefixLength, Lookup lookup) { LookupElement item = lookup.getCurrentItem(); if (item instanceof LiveTemplateLookupElement && lookup.isCompletion()) { - if (Character.isJavaIdentifierPart(c)) return Result.ADD_TO_PREFIX; + if (Character.isJavaIdentifierPart(c) || c == '%') return Result.ADD_TO_PREFIX; if (c == ((LiveTemplateLookupElement)item).getTemplateShortcut()) { return Result.SELECT_ITEM_AND_FINISH_LOOKUP;