From 933aee7d6062c4f5c5a147c15ca3d999f224f0b9 Mon Sep 17 00:00:00 2001 From: Nathanael Anderson Date: Wed, 14 Aug 2013 09:35:30 -0500 Subject: [PATCH] Fix bug in Line_Wrapper ignoring \n in most cases. (Causes text wrapping to be wrong) --- lib/line_wrapper.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/line_wrapper.coffee b/lib/line_wrapper.coffee index 3b18f0a..64a951a 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