UNPKG

@inst/vscode-bin-darwin

Version:

BINARY ONLY - VSCode binary deployment for macOS

50 lines (48 loc) 2.16 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); var BaseRenderLayer_1 = require("./BaseRenderLayer"); var Types_1 = require("../Types"); var LinkRenderLayer = (function (_super) { __extends(LinkRenderLayer, _super); function LinkRenderLayer(container, zIndex, colors, terminal) { var _this = _super.call(this, container, 'link', zIndex, true, colors) || this; _this._state = null; terminal.linkifier.on(Types_1.LinkHoverEventTypes.HOVER, function (e) { return _this._onLinkHover(e); }); terminal.linkifier.on(Types_1.LinkHoverEventTypes.LEAVE, function (e) { return _this._onLinkLeave(e); }); return _this; } LinkRenderLayer.prototype.resize = function (terminal, dim, charSizeChanged) { _super.prototype.resize.call(this, terminal, dim, charSizeChanged); this._state = null; }; LinkRenderLayer.prototype.reset = function (terminal) { this._clearCurrentLink(); }; LinkRenderLayer.prototype._clearCurrentLink = function () { if (this._state) { this.clearCells(this._state.x, this._state.y, this._state.length, 1); this._state = null; } }; LinkRenderLayer.prototype._onLinkHover = function (e) { this._ctx.fillStyle = this._colors.foreground; this.fillBottomLineAtCells(e.x, e.y, e.length); this._state = e; }; LinkRenderLayer.prototype._onLinkLeave = function (e) { this._clearCurrentLink(); }; return LinkRenderLayer; }(BaseRenderLayer_1.BaseRenderLayer)); exports.LinkRenderLayer = LinkRenderLayer; //# sourceMappingURL=LinkRenderLayer.js.map