Skip to content
This repository was archived by the owner on Jul 9, 2020. It is now read-only.

Commit e45bfdc

Browse files
committed
Merge pull request #264 from Cottser/80-char-fix
Fix case of incorrectly drawn 80-character rulers
2 parents caa5242 + fc8f7a4 commit e45bfdc

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/js/plugins/patch.review.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -448,8 +448,8 @@ Drupal.dreditor.patchReview.behaviors.setup = function (context, code) {
448448
var ln2 = '';
449449
var ln1content = '';
450450
var ln2content = '';
451-
var maxGutter = 0;
452-
var gutter, maxln1, maxln2;
451+
var maxln1 = 0;
452+
var maxln2 = 0;
453453
for (var n in code) {
454454
var ln1o = true;
455455
var ln2o = true;
@@ -552,13 +552,13 @@ Drupal.dreditor.patchReview.behaviors.setup = function (context, code) {
552552
classes = (classes.length ? ' class="' + classes.join(' ') + '"' : '');
553553
line = '<tr' + classes + '><td class="ln" data-line-number="' + ln1content + '"></td><td class="ln" data-line-number="' + ln2content + '"></td><td><span class="pre">' + line + '</span></td></tr>';
554554

555-
// Calculate the longest combination of line numbers in the gutter, used
555+
// Calculate the largest line numbers in the gutter, used
556556
// for determining the position of the 80 character ruler.
557-
gutter = ("" + ln1content + ln2content);
558-
if (gutter.length > maxGutter) {
557+
if (ln1content > maxln1) {
559558
maxln1 = ln1content;
559+
}
560+
if (ln2content > maxln2) {
560561
maxln2 = ln2content;
561-
maxGutter = gutter.length;
562562
}
563563

564564
// Append line to parsed code.

0 commit comments

Comments
 (0)