Fix bug in Line_Wrapper ignoring \n in most cases. (Causes text wrapping to be wrong)

This commit is contained in:
Nathanael Anderson 2013-08-14 09:35:30 -05:00
parent 96bba3a035
commit 933aee7d60

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