Style + import lodash

This commit is contained in:
Bryan Ashby 2016-07-25 09:30:49 -06:00
parent ea0ce74d2e
commit 0aa75c17c1
1 changed files with 10 additions and 10 deletions

View File

@ -1,14 +1,13 @@
/* jslint node: true */ /* jslint node: true */
'use strict'; 'use strict';
var TextView = require('./text_view.js').TextView; // ENiGMA½
var miscUtil = require('./misc_util.js'); const TextView = require('./text_view.js').TextView;
var strUtil = require('./string_util.js'); const miscUtil = require('./misc_util.js');
//var ansi = require('./ansi_term.js'); const strUtil = require('./string_util.js');
//var util = require('util'); // deps
var assert = require('assert'); const _ = require('lodash');
var _ = require('lodash');
exports.EditTextView = EditTextView; exports.EditTextView = EditTextView;
@ -23,8 +22,8 @@ function EditTextView(options) {
this.cursorPos = { row : 0, col : 0 }; this.cursorPos = { row : 0, col : 0 };
this.clientBackspace = function() { this.clientBackspace = function() {
var fillCharSGR = this.getStyleSGR(1) || this.getSGR(); const fillCharSGR = this.getStyleSGR(1) || this.getSGR();
this.client.term.write('\b' + fillCharSGR + this.fillChar + '\b' + this.getFocusSGR()); this.client.term.write(`\b${fillCharSGR}${this.fillChar}\b${this.getFocusSGR()}`);
}; };
} }
@ -69,8 +68,9 @@ EditTextView.prototype.onKeyPress = function(ch, key) {
this.cursorPos.col += 1; this.cursorPos.col += 1;
if(_.isString(this.textMaskChar)) { if(_.isString(this.textMaskChar)) {
if(this.textMaskChar.length > 0) if(this.textMaskChar.length > 0) {
this.client.term.write(this.textMaskChar); this.client.term.write(this.textMaskChar);
}
} else { } else {
this.client.term.write(ch); this.client.term.write(ch);
} }