diff --git a/addon/wrap/hardwrap.js b/addon/wrap/hardwrap.js index 2259e0e11..f194946c5 100644 --- a/addon/wrap/hardwrap.js +++ b/addon/wrap/hardwrap.js @@ -35,10 +35,10 @@ for (; at > 0; --at) if (wrapOn.test(text.slice(at - 1, at + 1))) break; - if ((at == 0) && (!forceBreak)) { + if (at == 0 && !forceBreak) { // didn't find a break point before column, in non-forceBreak mode try to // find one after 'column'. - for (at = column+1; at < text.length-1; ++at) { + for (at = column + 1; at < text.length - 1; ++at) { if (wrapOn.test(text.slice(at - 1, at + 1))) break; } } @@ -56,7 +56,7 @@ from = cm.clipPos(from); to = cm.clipPos(to); var column = options.column || 80; var wrapOn = options.wrapOn || /\s\S|-[^\.\d]/; - var forceBreak = options.forceBreak !== false; + var forceBreak = options.forceBreak !== false; var killTrailing = options.killTrailingSpace !== false; var changes = [], curLine = "", curNo = from.line; var lines = cm.getRange(from, to, false); @@ -91,7 +91,7 @@ } while (curLine.length > column) { var bp = findBreakPoint(curLine, column, wrapOn, killTrailing, forceBreak); - if ((bp.from != bp.to) || (forceBreak)) { + if (bp.from != bp.to || forceBreak) { changes.push({text: ["", leadingSpace], from: Pos(curNo, bp.from), to: Pos(curNo, bp.to)});