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

Commit

Permalink
Merge pull request #264 from Cottser/80-char-fix
Browse files Browse the repository at this point in the history
Fix case of incorrectly drawn 80-character rulers
  • Loading branch information
star-szr committed Sep 5, 2015
2 parents caa5242 + fc8f7a4 commit e45bfdc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/js/plugins/patch.review.js
Original file line number Diff line number Diff line change
Expand Up @@ -448,8 +448,8 @@ Drupal.dreditor.patchReview.behaviors.setup = function (context, code) {
var ln2 = '';
var ln1content = '';
var ln2content = '';
var maxGutter = 0;
var gutter, maxln1, maxln2;
var maxln1 = 0;
var maxln2 = 0;
for (var n in code) {
var ln1o = true;
var ln2o = true;
Expand Down Expand Up @@ -552,13 +552,13 @@ Drupal.dreditor.patchReview.behaviors.setup = function (context, code) {
classes = (classes.length ? ' class="' + classes.join(' ') + '"' : '');
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>';

// Calculate the longest combination of line numbers in the gutter, used
// Calculate the largest line numbers in the gutter, used
// for determining the position of the 80 character ruler.
gutter = ("" + ln1content + ln2content);
if (gutter.length > maxGutter) {
if (ln1content > maxln1) {
maxln1 = ln1content;
}
if (ln2content > maxln2) {
maxln2 = ln2content;
maxGutter = gutter.length;
}

// Append line to parsed code.
Expand Down

0 comments on commit e45bfdc

Please sign in to comment.