Do not close completion popup on % (WEB-26250)

This commit is contained in:
Alexander Zolotov
2017-04-10 22:28:43 +03:00
parent f85c22eecf
commit e3a525339b
@@ -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;