assets/js/matrix.js:Matrix.prototype.{ansi,mirc}(): only reset {bg,fg}_ when processing a new row vs. new cell (via spoke.)

This commit is contained in:
Lucio Andrés Illanes Albornoz 2019-08-27 07:59:35 +02:00
parent 2efca3371f
commit f63ee53191

View File

@ -241,9 +241,8 @@ Matrix.prototype.ascii = function () {
} }
Matrix.prototype.ansi = function (opts) { Matrix.prototype.ansi = function (opts) {
var lines = this.aa.map(function(row, y){ var lines = this.aa.map(function(row, y){
var last, line = "" var last, line = "", bg_ = -1, fg_ = -1
row.forEach(function(lex, x) { row.forEach(function(lex, x) {
var bg_ = -1, fg_ = -1
if (lex.eqColor(last)) { if (lex.eqColor(last)) {
line += lex.sanitize() line += lex.sanitize()
} }
@ -262,9 +261,8 @@ Matrix.prototype.ansi = function (opts) {
Matrix.prototype.mirc = function (opts) { Matrix.prototype.mirc = function (opts) {
var cutoff = false var cutoff = false
var lines = this.aa.map(function(row, y){ var lines = this.aa.map(function(row, y){
var last, line = "" var last, line = "", bg_ = -1, fg_ = -1
row.forEach(function(lex, x) { row.forEach(function(lex, x) {
var bg_ = -1, fg_ = -1
if (lex.eqColor(last)) { if (lex.eqColor(last)) {
line += lex.sanitize() line += lex.sanitize()
} }