Merge pull request #152 from Nathanaela/Text_Wrapping_Fix

Fix bug in Line_Wrapper ignoring \n in most cases.  (Causes text wrapping to be wrong)
This commit is contained in:
Devon Govett 2013-11-09 22:45:37 -08:00
commit d2b728fdff

View File

@ -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