more accurate final space treatment in Ctrl+N (IDEA-67757)

This commit is contained in:
peter
2011-04-08 20:19:10 +02:00
parent 6cfc5f6216
commit c847b49717
@@ -539,7 +539,7 @@ public class NameUtil {
}
// there's more in the pattern, but no more words
if (nextStart == name.length()) {
if (patternIndex + i == myPattern.length - 1 && ' ' == myPattern[patternIndex + i] && i + nameIndex == name.length()) {
if (patternIndex + i == myPattern.length - 1 && ' ' == myPattern[patternIndex + i] && (i == 1 || i + nameIndex == name.length())) {
return FList.<TextRange>emptyList().prepend(TextRange.from(nameIndex, i));
}