xterm-addon-webgl
Advanced tools
Comparing version 0.12.0-beta.14 to 0.12.0-beta.15
@@ -24,3 +24,3 @@ "use strict"; | ||
__extends(CursorRenderLayer, _super); | ||
function CursorRenderLayer(container, zIndex, colors, _terminal, _onRequestRefreshRowsEvent) { | ||
function CursorRenderLayer(terminal, container, zIndex, colors, _terminal, _onRequestRefreshRowsEvent) { | ||
var _this = _super.call(this, container, 'cursor', zIndex, true, colors) || this; | ||
@@ -42,2 +42,3 @@ _this._terminal = _terminal; | ||
}; | ||
_this.onOptionsChanged(terminal); | ||
return _this; | ||
@@ -56,21 +57,16 @@ } | ||
CursorRenderLayer.prototype.reset = function (terminal) { | ||
var _a; | ||
this._clearCursor(); | ||
if (this._cursorBlinkStateManager) { | ||
this._cursorBlinkStateManager.dispose(); | ||
this.onOptionsChanged(terminal); | ||
} | ||
(_a = this._cursorBlinkStateManager) === null || _a === void 0 ? void 0 : _a.restartBlinkAnimation(terminal); | ||
this.onOptionsChanged(terminal); | ||
}; | ||
CursorRenderLayer.prototype.onBlur = function (terminal) { | ||
if (this._cursorBlinkStateManager) { | ||
this._cursorBlinkStateManager.pause(); | ||
} | ||
var _a; | ||
(_a = this._cursorBlinkStateManager) === null || _a === void 0 ? void 0 : _a.pause(); | ||
this._onRequestRefreshRowsEvent.fire({ start: terminal.buffer.active.cursorY, end: terminal.buffer.active.cursorY }); | ||
}; | ||
CursorRenderLayer.prototype.onFocus = function (terminal) { | ||
if (this._cursorBlinkStateManager) { | ||
this._cursorBlinkStateManager.resume(terminal); | ||
} | ||
else { | ||
this._onRequestRefreshRowsEvent.fire({ start: terminal.buffer.active.cursorY, end: terminal.buffer.active.cursorY }); | ||
} | ||
var _a; | ||
(_a = this._cursorBlinkStateManager) === null || _a === void 0 ? void 0 : _a.resume(terminal); | ||
this._onRequestRefreshRowsEvent.fire({ start: terminal.buffer.active.cursorY, end: terminal.buffer.active.cursorY }); | ||
}; | ||
@@ -94,5 +90,4 @@ CursorRenderLayer.prototype.onOptionsChanged = function (terminal) { | ||
CursorRenderLayer.prototype.onCursorMove = function (terminal) { | ||
if (this._cursorBlinkStateManager) { | ||
this._cursorBlinkStateManager.restartBlinkAnimation(terminal); | ||
} | ||
var _a; | ||
(_a = this._cursorBlinkStateManager) === null || _a === void 0 ? void 0 : _a.restartBlinkAnimation(terminal); | ||
}; | ||
@@ -257,2 +252,3 @@ CursorRenderLayer.prototype.onGridChanged = function (terminal, startRow, endRow) { | ||
window.clearInterval(this._blinkInterval); | ||
this._blinkInterval = undefined; | ||
} | ||
@@ -259,0 +255,0 @@ this._blinkStartTimeout = window.setTimeout(function () { |
@@ -45,3 +45,3 @@ "use strict"; | ||
new LinkRenderLayer_1.LinkRenderLayer(_this._core.screenElement, 2, _this._colors, _this._core), | ||
new CursorRenderLayer_1.CursorRenderLayer(_this._core.screenElement, 3, _this._colors, _this._core, _this._onRequestRedraw) | ||
new CursorRenderLayer_1.CursorRenderLayer(_terminal, _this._core.screenElement, 3, _this._colors, _this._core, _this._onRequestRedraw) | ||
]; | ||
@@ -48,0 +48,0 @@ _this.dimensions = { |
{ | ||
"name": "xterm-addon-webgl", | ||
"version": "0.12.0-beta.14", | ||
"version": "0.12.0-beta.15", | ||
"author": { | ||
@@ -5,0 +5,0 @@ "name": "The xterm.js authors", |
@@ -34,2 +34,3 @@ /** | ||
constructor( | ||
terminal: Terminal, | ||
container: HTMLElement, | ||
@@ -54,3 +55,3 @@ zIndex: number, | ||
}; | ||
// TODO: Consider initial options? Maybe onOptionsChanged should be called at the end of open? | ||
this.onOptionsChanged(terminal); | ||
} | ||
@@ -72,12 +73,8 @@ | ||
this._clearCursor(); | ||
if (this._cursorBlinkStateManager) { | ||
this._cursorBlinkStateManager.dispose(); | ||
this.onOptionsChanged(terminal); | ||
} | ||
this._cursorBlinkStateManager?.restartBlinkAnimation(terminal); | ||
this.onOptionsChanged(terminal); | ||
} | ||
public onBlur(terminal: Terminal): void { | ||
if (this._cursorBlinkStateManager) { | ||
this._cursorBlinkStateManager.pause(); | ||
} | ||
this._cursorBlinkStateManager?.pause(); | ||
this._onRequestRefreshRowsEvent.fire({ start: terminal.buffer.active.cursorY, end: terminal.buffer.active.cursorY }); | ||
@@ -87,7 +84,4 @@ } | ||
public onFocus(terminal: Terminal): void { | ||
if (this._cursorBlinkStateManager) { | ||
this._cursorBlinkStateManager.resume(terminal); | ||
} else { | ||
this._onRequestRefreshRowsEvent.fire({ start: terminal.buffer.active.cursorY, end: terminal.buffer.active.cursorY }); | ||
} | ||
this._cursorBlinkStateManager?.resume(terminal); | ||
this._onRequestRefreshRowsEvent.fire({ start: terminal.buffer.active.cursorY, end: terminal.buffer.active.cursorY }); | ||
} | ||
@@ -112,5 +106,3 @@ | ||
public onCursorMove(terminal: Terminal): void { | ||
if (this._cursorBlinkStateManager) { | ||
this._cursorBlinkStateManager.restartBlinkAnimation(terminal); | ||
} | ||
this._cursorBlinkStateManager?.restartBlinkAnimation(terminal); | ||
} | ||
@@ -310,2 +302,3 @@ | ||
window.clearInterval(this._blinkInterval); | ||
this._blinkInterval = undefined; | ||
} | ||
@@ -312,0 +305,0 @@ |
@@ -63,3 +63,3 @@ /** | ||
new LinkRenderLayer(this._core.screenElement!, 2, this._colors, this._core), | ||
new CursorRenderLayer(this._core.screenElement!, 3, this._colors, this._core, this._onRequestRedraw) | ||
new CursorRenderLayer(_terminal, this._core.screenElement!, 3, this._colors, this._core, this._onRequestRedraw) | ||
]; | ||
@@ -66,0 +66,0 @@ this.dimensions = { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
687687
5443