mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 21:55:38 +00:00
Extract constant
This commit is contained in:
parent
31a8fe2690
commit
05aab259e7
|
@ -4,16 +4,16 @@
|
|||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
|
||||
import { disposeAll } from '../util/dispose';
|
||||
import { isMarkdownFile } from './file';
|
||||
|
||||
|
||||
export class MarkdownFileTopmostLineMonitor {
|
||||
private readonly disposables: vscode.Disposable[] = [];
|
||||
|
||||
private readonly pendingUpdates = new Map<string, number>();
|
||||
|
||||
private readonly throttle = 50;
|
||||
|
||||
constructor() {
|
||||
vscode.window.onDidChangeTextEditorVisibleRanges(event => {
|
||||
if (isMarkdownFile(event.textEditor.document)) {
|
||||
|
@ -47,7 +47,7 @@ export class MarkdownFileTopmostLineMonitor {
|
|||
});
|
||||
this.pendingUpdates.delete(key);
|
||||
}
|
||||
}, 50);
|
||||
}, this.throttle);
|
||||
}
|
||||
|
||||
this.pendingUpdates.set(key, line);
|
||||
|
|
Loading…
Reference in a new issue