IDEA-128178 Tab title limit: truncation could be improved

This commit is contained in:
Vassiliy.Kudryashov
2014-08-05 15:47:47 +04:00
parent 63200bc2dd
commit 2ad0816601
@@ -2696,8 +2696,8 @@ public class StringUtil extends StringUtilRt {
index = Math.max(0, (words.size() - 1) / 2);
String aWord = words.get(index);
words.remove(index);
if (words.size() < 2) {
int toCut = length - removedLength - maxWidth + 3;
int toCut = length - removedLength - maxWidth + 3;
if (words.size() < 2 || (toCut < aWord.length() - 2 && removedLength == 0)) {
int pos = (aWord.length() - toCut) / 2;
toPaste = aWord.substring(0, pos) + "..." + aWord.substring(pos+toCut);
break;