git://git.nikiroo.be
/
fanfix.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
weblib: fix delete and imprt
[fanfix.git]
/
src
/
jexer
/
TDirectoryList.java
diff --git
a/src/jexer/TDirectoryList.java
b/src/jexer/TDirectoryList.java
index e00d14f696755d5a6756c7a031c0d8eda3cdca25..322ff5c4e5cb493f93cf356716117d2274156d26 100644
(file)
--- 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 java.util.List;
import java.util.Map;
+import jexer.bits.StringUtils;
+
/**
* TDirectoryList shows the files within a directory.
*/
/**
* 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();
*/
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));
name = name.substring(0, 17) + "...";
}
return String.format("%-20s %5dk", name, (file.length() / 1024));