From 7f0579fc6e5771bbcad36591ab54119c4fe66dbd Mon Sep 17 00:00:00 2001 From: Florrie Date: Thu, 16 Jul 2020 14:04:25 -0300 Subject: improve & use our own word wrapping code --- ui/WrapLabel.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'ui/WrapLabel.js') diff --git a/ui/WrapLabel.js b/ui/WrapLabel.js index babf462..7036908 100644 --- a/ui/WrapLabel.js +++ b/ui/WrapLabel.js @@ -1,5 +1,5 @@ const ansi = require('../util/ansi') -const wrap = require('word-wrap') +const wrap = require('../util/wrap') const Label = require('./Label') @@ -29,9 +29,7 @@ module.exports = class WrapLabel extends Label { return [] } - const options = {width: this.w, indent: ''} - return wrap(this.text, options).split('\n') - .map(l => l.trim()) + return wrap(this.text, this.w).map(l => l.trim()) } get h() { -- cgit 1.3.0-6-gf8a5