Merge branch 'subtree'
[fanfix.git] / src / jexer / TDirectoryList.java
index e00d14f696755d5a6756c7a031c0d8eda3cdca25..322ff5c4e5cb493f93cf356716117d2274156d26 100644 (file)
@@ -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));