-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2092 from Tyriar/layering
Move BufferReflow and Marker to core
- Loading branch information
Showing
5 changed files
with
80 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** | ||
* Copyright (c) 2018 The xterm.js authors. All rights reserved. | ||
* @license MIT | ||
*/ | ||
|
||
import { EventEmitter2, IEvent } from '../../common/EventEmitter2'; | ||
import { Disposable } from '../../common/Lifecycle'; | ||
import { IMarker } from '../Types'; | ||
|
||
export class Marker extends Disposable implements IMarker { | ||
private static _nextId = 1; | ||
|
||
private _id: number = Marker._nextId++; | ||
public isDisposed: boolean = false; | ||
|
||
public get id(): number { return this._id; } | ||
|
||
private _onDispose = new EventEmitter2<void>(); | ||
public get onDispose(): IEvent<void> { return this._onDispose.event; } | ||
|
||
constructor( | ||
public line: number | ||
) { | ||
super(); | ||
} | ||
|
||
public dispose(): void { | ||
if (this.isDisposed) { | ||
return; | ||
} | ||
this.isDisposed = true; | ||
// Emit before super.dispose such that dispose listeners get a change to react | ||
this._onDispose.fire(); | ||
} | ||
} |