Skip to content

Commit 09943f9

Browse files
committed
[hardbreak addon] Adjust formatting
Issue #6338
1 parent 0682bcc commit 09943f9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

addon/wrap/hardwrap.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@
3535
for (; at > 0; --at)
3636
if (wrapOn.test(text.slice(at - 1, at + 1))) break;
3737

38-
if ((at == 0) && (!forceBreak)) {
38+
if (at == 0 && !forceBreak) {
3939
// didn't find a break point before column, in non-forceBreak mode try to
4040
// find one after 'column'.
41-
for (at = column+1; at < text.length-1; ++at) {
41+
for (at = column + 1; at < text.length - 1; ++at) {
4242
if (wrapOn.test(text.slice(at - 1, at + 1))) break;
4343
}
4444
}
@@ -56,7 +56,7 @@
5656
from = cm.clipPos(from); to = cm.clipPos(to);
5757
var column = options.column || 80;
5858
var wrapOn = options.wrapOn || /\s\S|-[^\.\d]/;
59-
var forceBreak = options.forceBreak !== false;
59+
var forceBreak = options.forceBreak !== false;
6060
var killTrailing = options.killTrailingSpace !== false;
6161
var changes = [], curLine = "", curNo = from.line;
6262
var lines = cm.getRange(from, to, false);
@@ -91,7 +91,7 @@
9191
}
9292
while (curLine.length > column) {
9393
var bp = findBreakPoint(curLine, column, wrapOn, killTrailing, forceBreak);
94-
if ((bp.from != bp.to) || (forceBreak)) {
94+
if (bp.from != bp.to || forceBreak) {
9595
changes.push({text: ["", leadingSpace],
9696
from: Pos(curNo, bp.from),
9797
to: Pos(curNo, bp.to)});

0 commit comments

Comments
 (0)