From 8b83fb2bafcf11b1981535f6dbc364db15153d87 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 30 Apr 2015 18:12:02 -0400 Subject: eqColor --- js/lex.js | 3 +++ js/matrix.js | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'js') diff --git a/js/lex.js b/js/lex.js index 641fd2e..12976d5 100644 --- a/js/lex.js +++ b/js/lex.js @@ -88,6 +88,9 @@ Lex.prototype.fill = function(fg, bg){ Lex.prototype.eq = function(lex){ return lex && this.fg == lex.fg && this.bg == lex.bg && this.char == lex.char } +Lex.prototype.eqColor = function(lex){ + return lex && this.fg == lex.fg && this.bg == lex.bg +} Lex.prototype.ne = function(lex){ return ! this.eq(lex) } diff --git a/js/matrix.js b/js/matrix.js index dc5d166..732820e 100644 --- a/js/matrix.js +++ b/js/matrix.js @@ -168,7 +168,7 @@ Matrix.prototype.mirc = function () { var lines = this.aa.map(function(row, y){ var last, line = "" row.forEach(function(lex, x) { - if (lex.eq(last)) { + if (lex.eqColor(last)) { line += lex.sanitize() } else { -- cgit v1.2.3-70-g09d2