X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTDirectoryList.java;h=322ff5c4e5cb493f93cf356716117d2274156d26;hb=12b90437b5f22c2ae6e9b9b14c3b62b60f6143e5;hp=e00d14f696755d5a6756c7a031c0d8eda3cdca25;hpb=a69ed767c9c07cf35cf1c5f7821fc009cfe79cd2;p=fanfix.git diff --git a/src/jexer/TDirectoryList.java b/src/jexer/TDirectoryList.java index e00d14f..322ff5c 100644 --- a/src/jexer/TDirectoryList.java +++ b/src/jexer/TDirectoryList.java @@ -34,6 +34,8 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import jexer.bits.StringUtils; + /** * TDirectoryList shows the files within a directory. */ @@ -223,7 +225,7 @@ public class TDirectoryList extends TList { */ private String renderFile(final File file) { String name = file.getName(); - if (name.length() > 20) { + if (StringUtils.width(name) > 20) { name = name.substring(0, 17) + "..."; } return String.format("%-20s %5dk", name, (file.length() / 1024));