« get me outta code hell

Use measureColumns in the appropriate places - tui-lib - Pure Node.js library for making visual command-line programs (ala vim, ncdu)
about summary refs log tree commit diff
path: root/ui/Pane.js
diff options
context:
space:
mode:
authorFlorrie <towerofnix@gmail.com>2018-12-05 16:54:10 -0400
committerFlorrie <towerofnix@gmail.com>2018-12-05 16:54:10 -0400
commitab193ed3fe91078551c0020e681a191e7b26a122 (patch)
tree9167ab573f8f82399cb238ce95c8c9c9b541083f /ui/Pane.js
parentd59d12196ad00a51d76e0ef4b6808ec2978f7649 (diff)
Use measureColumns in the appropriate places
TL;DR If you want to take into account the width of text, use
measureColumns instead of just checking the length of the text!
Diffstat (limited to 'ui/Pane.js')
-rw-r--r--ui/Pane.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/ui/Pane.js b/ui/Pane.js
index 4e08c55..b33a1b7 100644
--- a/ui/Pane.js
+++ b/ui/Pane.js
@@ -86,7 +86,7 @@ module.exports = class Pane extends DisplayElement {
 
     const pane = new Pane()
     pane.frameColor = ansi.C_WHITE
-    pane.w = text.length + 2
+    pane.w = ansi.measureColumns(text) + 2
     pane.h = 3
     parent.addChild(pane)