Fix issues with link state

- Scrolling will now clear the link renderer
- Refreshing a single line will now recalculate only that line

Fixes #959
Fixes #960
This commit is contained in:
Daniel Imms
2017-09-09 19:06:30 -07:00
parent 948eedba89
commit 0e3518409e
4 changed files with 52 additions and 14 deletions
+6 -2
View File
@@ -48,8 +48,11 @@ import { MouseZoneManager } from './input/MouseZoneManager';
import { initialize as initializeCharAtlas } from './renderer/CharAtlas';
import { IRenderer } from './renderer/Interfaces';
// Declare for RequireJS in loadAddon
// Declares required for loadAddon
declare var exports: any;
declare var module: any;
declare var define: any;
declare var require: any;
// Let it work inside Node.js for automated testing purposes.
const document = (typeof window !== 'undefined') ? window.document : null;
@@ -588,6 +591,7 @@ export class Terminal extends EventEmitter implements ITerminal, IInputHandlingT
this.syncBellSound();
this._mouseZoneManager = new MouseZoneManager(this);
this.on('scroll', () => this._mouseZoneManager.clearAll());
this.linkifier.attachToDom(this._mouseZoneManager);
// Create the container that will hold helpers like the textarea for
@@ -1034,7 +1038,7 @@ export class Terminal extends EventEmitter implements ITerminal, IInputHandlingT
*/
private queueLinkification(start: number, end: number): void {
if (this.linkifier) {
this.linkifier.linkifyRows(0, this.rows);
this.linkifier.linkifyRows(start, end);
}
}