Merge pull request #764 from alafr/undo-bug

Fix linewrapper bug
This commit is contained in:
alafr 2018-02-02 11:53:17 +01:00 committed by GitHub
commit d1cb5268b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -137,9 +137,6 @@ class LineWrapper extends EventEmitter
wc++
if bk.required or w > @spaceLeft
if bk.required
@emit 'lastLine', options, this
# if the user specified a max height and an ellipsis, and is about to pass the
# max height and max columns after the next line, append the ellipsis
lh = @document.currentLineHeight(true)
@ -155,10 +152,14 @@ class LineWrapper extends EventEmitter
buffer = buffer + @ellipsis
if bk.required and w > @spaceLeft
buffer = word
textWidth = w
wc = 1
if bk.required
if w > @spaceLeft
emitLine()
buffer = word
textWidth = w
wc = 1
@emit 'lastLine', options, this
emitLine()