From 03fff9bca9b0260d330a1cae65d03f17afc4dbd8 Mon Sep 17 00:00:00 2001 From: peter Date: Fri, 1 Apr 2011 18:58:10 +0200 Subject: [PATCH] merge matching fragments --- platform/util/src/com/intellij/psi/codeStyle/NameUtil.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/platform/util/src/com/intellij/psi/codeStyle/NameUtil.java b/platform/util/src/com/intellij/psi/codeStyle/NameUtil.java index ce37bf45e270..2bd1019e3cc3 100644 --- a/platform/util/src/com/intellij/psi/codeStyle/NameUtil.java +++ b/platform/util/src/com/intellij/psi/codeStyle/NameUtil.java @@ -543,6 +543,10 @@ public class NameUtil { while (i > 0) { FList ranges = matchName(name, patternIndex + i, nextStart); if (ranges != null) { + TextRange head = ranges.getHead(); + if (head != null && head.getStartOffset() == nameIndex + i) { + return ranges.getTail().prepend(new TextRange(nameIndex, head.getEndOffset())); + } return ranges.prepend(TextRange.from(nameIndex, i)); } i--;