|
@ -50,18 +50,11 @@ export class LineAnnotationController extends Disposable { |
|
|
const cfg = configuration.get<IConfig>(); |
|
|
const cfg = configuration.get<IConfig>(); |
|
|
if (cfg.currentLine.enabled) { |
|
|
if (cfg.currentLine.enabled) { |
|
|
this._enabled = true; |
|
|
this._enabled = true; |
|
|
|
|
|
|
|
|
Container.lineTracker.start( |
|
|
|
|
|
this, |
|
|
|
|
|
Disposable.from( |
|
|
|
|
|
Container.lineTracker.onDidChangeActiveLines(this.onActiveLinesChanged, this) |
|
|
|
|
|
) |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
this.resume(); |
|
|
} |
|
|
} |
|
|
else { |
|
|
else { |
|
|
this._enabled = false; |
|
|
this._enabled = false; |
|
|
|
|
|
|
|
|
Container.lineTracker.stop(this); |
|
|
|
|
|
|
|
|
this.setLineTracker(false); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -74,6 +67,8 @@ export class LineAnnotationController extends Disposable { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
resume(reason: 'debugging' | 'user' = 'user') { |
|
|
resume(reason: 'debugging' | 'user' = 'user') { |
|
|
|
|
|
this.setLineTracker(true); |
|
|
|
|
|
|
|
|
switch (reason) { |
|
|
switch (reason) { |
|
|
case 'debugging': |
|
|
case 'debugging': |
|
|
if (this._suspended !== 'user') { |
|
|
if (this._suspended !== 'user') { |
|
@ -94,6 +89,8 @@ export class LineAnnotationController extends Disposable { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
suspend(reason: 'debugging' | 'user' = 'user') { |
|
|
suspend(reason: 'debugging' | 'user' = 'user') { |
|
|
|
|
|
this.setLineTracker(false); |
|
|
|
|
|
|
|
|
if (this._suspended !== 'user') { |
|
|
if (this._suspended !== 'user') { |
|
|
this._suspended = reason; |
|
|
this._suspended = reason; |
|
|
return true; |
|
|
return true; |
|
@ -201,4 +198,21 @@ export class LineAnnotationController extends Disposable { |
|
|
|
|
|
|
|
|
editor.setDecorations(annotationDecoration, decorations); |
|
|
editor.setDecorations(annotationDecoration, decorations); |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private setLineTracker(enabled: boolean) { |
|
|
|
|
|
if (enabled) { |
|
|
|
|
|
if (!Container.lineTracker.isSubscribed(this)) { |
|
|
|
|
|
Container.lineTracker.start( |
|
|
|
|
|
this, |
|
|
|
|
|
Disposable.from( |
|
|
|
|
|
Container.lineTracker.onDidChangeActiveLines(this.onActiveLinesChanged, this) |
|
|
|
|
|
) |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Container.lineTracker.stop(this); |
|
|
|
|
|
} |
|
|
|
|
|
} |