mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-128179 Tab title limit: truncation in case of "directory name\file name" tile could be improved
This commit is contained in:
+1
-1
@@ -188,7 +188,7 @@ public class EditorTabsConfigurable implements EditorOptionsProvider {
|
||||
if (temp.trim().length() > 0) {
|
||||
try {
|
||||
int newTabTitleLimit = Integer.parseInt(temp);
|
||||
newTabTitleLimit = Math.max(10, Math.min(100, newTabTitleLimit));
|
||||
newTabTitleLimit = Math.max(25, Math.min(100, newTabTitleLimit));
|
||||
if (newTabTitleLimit != uiSettings.EDITOR_TAB_TITLE_LIMIT){
|
||||
uiSettings.EDITOR_TAB_TITLE_LIMIT = newTabTitleLimit;
|
||||
uiSettingsChanged = true;
|
||||
|
||||
@@ -2674,12 +2674,19 @@ public class StringUtil extends StringUtilRt {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (i > 0 && (ch == '/' || ch == '.' || Character.isUpperCase(ch))) {
|
||||
if (i > 0 && (ch == '/' || ch == '\\' || ch == '.' || Character.isUpperCase(ch))) {
|
||||
words.add(builder.toString());
|
||||
builder.delete(0, builder.length());
|
||||
}
|
||||
builder.append(ch);
|
||||
}
|
||||
for (int i = 0; i < words.size(); i++) {
|
||||
String word = words.get(i);
|
||||
if (i < words.size() - 1 && word.length() == 1) {
|
||||
words.remove(i);
|
||||
words.set(i, word + words.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
int removedLength = 0;
|
||||
|
||||
|
||||
@@ -197,7 +197,7 @@ public class StringUtilTest extends TestCase {
|
||||
}
|
||||
|
||||
public void testShortened() {
|
||||
String[] names = {"AVeryVeeryLongClassName.java", "com.test.SomeJAVAClassName.java", "strangelowercaseclassname.java", "PrefixPostfix.java"};
|
||||
String[] names = {"AVeryVeeryLongClassName.java", "com.test.SomeJAVAClassName.java", "strangelowercaseclassname.java", "PrefixPostfix.java", "SomeJAVAClassName.java"};
|
||||
for (String name : names) {
|
||||
for (int i = name.length() + 1; i > 15; i--) {
|
||||
String shortened = StringUtil.getShortened(name, i);
|
||||
|
||||
Reference in New Issue
Block a user