Fix word wrap crash reported by user when pipe codes are in play

This commit is contained in:
Bryan Ashby
2018-02-04 10:27:32 -07:00
parent 7a6188bba0
commit 0a486d290f
2 changed files with 14 additions and 5 deletions

View File

@@ -49,7 +49,7 @@ function wordWrapText(text, options) {
function appendWord() {
word.match(REGEXP_GOBBLE).forEach( w => {
renderLen = renderStringLength(w);
renderLen = renderStringLength(w, { ansi : true, pipe : false } );
if(result.renderLen[i] + renderLen > options.width) {
if(0 === i) {