add super.dispose, add oDispose to API

This commit is contained in:
Jörg Breitbart
2020-09-27 15:59:11 +02:00
parent b0768f18ca
commit f5a4eed27c
3 changed files with 9 additions and 0 deletions
+1
View File
@@ -183,6 +183,7 @@ export interface IMarker extends IDisposable {
readonly id: number;
readonly isDisposed: boolean;
readonly line: number;
onDispose: IEvent<void>;
}
export interface IModes {
insertMode: boolean;
+1
View File
@@ -32,5 +32,6 @@ export class Marker extends Disposable implements IMarker {
this.line = -1;
// Emit before super.dispose such that dispose listeners get a change to react
this._onDispose.fire();
super.dispose();
}
}
+7
View File
@@ -382,6 +382,13 @@ declare module 'xterm' {
* -1 if the marker has been disposed.
*/
readonly line: number;
/**
* Event listener to get notified when the marker gets disposed. Automatic disposal
* might happen for a marker, that got invalidated by scrolling out or removal of
* a line from the buffer.
*/
onDispose: IEvent<void>;
}
/**