Merge commit '77d3a60869e7a780c6ae069e51530e1eacece5e2'
[fanfix.git] / src / jexer / ttree / TTreeViewWindow.java
index 2c642063812c2262677f12f9aeb0417149b7f400..f418383ecf43d637c14b81cceedd914b44b54179 100644 (file)
@@ -3,7 +3,7 @@
  *
  * The MIT License (MIT)
  *
- * Copyright (C) 2017 Kevin Lamonte
+ * Copyright (C) 2019 Kevin Lamonte
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -34,6 +34,7 @@ import jexer.THScroller;
 import jexer.TScrollableWindow;
 import jexer.TVScroller;
 import jexer.TWidget;
+import jexer.bits.StringUtils;
 import jexer.event.TKeypressEvent;
 import jexer.event.TMouseEvent;
 import jexer.event.TResizeEvent;
@@ -301,7 +302,7 @@ public class TTreeViewWindow extends TScrollableWindow {
                 selectedRow++;
             }
 
-            int lineWidth = item.getText().length()
+            int lineWidth = StringUtils.width(item.getText())
                 + item.getPrefix().length() + 4;
             if (lineWidth > maxLineWidth) {
                 maxLineWidth = lineWidth;