Skip to content

Commit

Permalink
[hardwrap addon] Fix corner case for words whose length equals the wr…
Browse files Browse the repository at this point in the history
…ap column

Issue #4069
  • Loading branch information
marijnh committed Jun 20, 2016
1 parent 76e252d commit 592b4d1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion addon/wrap/hardwrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
}

function findBreakPoint(text, column, wrapOn, killTrailingSpace) {
for (var at = column; at > 0; --at)
var at = column
while (at < text.length && text.charAt(at) == " ") at++
for (; at > 0; --at)
if (wrapOn.test(text.slice(at - 1, at + 1))) break;
for (var first = true;; first = false) {
var endOfText = at;
Expand Down

0 comments on commit 592b4d1

Please sign in to comment.