Move all parser state handling into the parser

This commit is contained in:
Daniel Imms
2017-01-09 15:00:37 -08:00
parent f4267c4f74
commit 6deaaa8ef8
2 changed files with 3 additions and 4 deletions
+3
View File
@@ -206,11 +206,13 @@ export class Parser {
;
case 'D':
this._terminal.index();
this.state = ParserState.NORMAL;
break;
// ESC M Reverse Index ( RI is 0x8d).
case 'M':
this._terminal.reverseIndex();
this.state = ParserState.NORMAL;
break;
// ESC % Select default/utf-8 character set.
@@ -319,6 +321,7 @@ export class Parser {
// ESC H Tab Set (HTS is 0x88).
case 'H':
this._terminal.tabSet();
this.state = ParserState.NORMAL;
break;
// ESC = Application Keypad (DECKPAM).
-4
View File
@@ -148,7 +148,6 @@ function Terminal(options) {
this.cursorState = 0;
this.cursorHidden = false;
this.convertEol;
this.state = 0;
this.queue = '';
this.scrollTop = 0;
this.scrollBottom = this.rows - 1;
@@ -2173,7 +2172,6 @@ Terminal.prototype.index = function() {
this.y--;
this.scroll();
}
this.state = normal;
};
@@ -2195,7 +2193,6 @@ Terminal.prototype.reverseIndex = function() {
} else {
this.y--;
}
this.state = normal;
};
@@ -2218,7 +2215,6 @@ Terminal.prototype.reset = function() {
*/
Terminal.prototype.tabSet = function() {
this.tabs[this.x] = true;
this.state = normal;
};