diff --git a/lib/line_wrapper.coffee b/lib/line_wrapper.coffee index 107edd2..887f1d2 100644 --- a/lib/line_wrapper.coffee +++ b/lib/line_wrapper.coffee @@ -64,7 +64,7 @@ class LineWrapper extends EventEmitter for word, wi in words w = wordWidths[word] ?= width(word, options) + charSpacing + wordSpacing - if w > spaceLeft + if w > spaceLeft or word is '\n' options.textWidth = width(buffer.trim(), options) + wordSpacing * (wc - 1) @emit 'line', buffer.trim(), options, this