From 8b1a2603bf0001070c65efd4103237b874b0f50c Mon Sep 17 00:00:00 2001 From: Konstantin Bulenkov Date: Mon, 11 Jan 2010 19:03:26 +0300 Subject: [PATCH] IDEADEV-42159 I18n String Folding: clip string if it's too long --- .../intellij/codeInspection/i18n/folding/PropertyFoldingBuilder.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/java-i18n/src/com/intellij/codeInspection/i18n/folding/PropertyFoldingBuilder.java b/plugins/java-i18n/src/com/intellij/codeInspection/i18n/folding/PropertyFoldingBuilder.java index 5ff8dbcb8a..8fe59ac022 100644 --- a/plugins/java-i18n/src/com/intellij/codeInspection/i18n/folding/PropertyFoldingBuilder.java +++ b/plugins/java-i18n/src/com/intellij/codeInspection/i18n/folding/PropertyFoldingBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2010 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. @@ -36,6 +36,7 @@ import java.util.*; * @author Konstantin Bulenkov */ public class PropertyFoldingBuilder extends FoldingBuilderEx { + private static final int FOLD_MAX_LENGTH = 50; @NotNull public FoldingDescriptor[] buildFoldRegions(@NotNull PsiElement element, @NotNull Document document, boolean quick) { @@ -134,7 +135,7 @@ public class PropertyFoldingBuilder extends FoldingBuilderEx { if (!text.equals(methodCallExpression.getText())) { text = text.replace("''", "'"); } - return text; + return text.length() > FOLD_MAX_LENGTH ? text.substring(0, FOLD_MAX_LENGTH - 3) + "..." : text; } } } -- 2.11.4.GIT