From d181065d0395de3088ceea4956a2ae9caf3d208e Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Mon, 6 Feb 2017 16:04:31 -0500 Subject: [PATCH] Hides inline annotations if the doc is dirty --- src/blameStatusBarController.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/blameStatusBarController.ts b/src/blameStatusBarController.ts index 6f8a6f2..2ba9b0f 100644 --- a/src/blameStatusBarController.ts +++ b/src/blameStatusBarController.ts @@ -211,6 +211,20 @@ export default class BlameStatusBarController extends Disposable { } if (this._config.blame.annotation.activeLine !== 'off') { + let activeLine = this._config.blame.annotation.activeLine; + + // Because the inline annotations can be noisy -- only show them if the document isn't dirty + if (editor && editor.document && editor.document.isDirty) { + editor.setDecorations(activeLineDecoration, []); + switch (activeLine) { + case 'both': + activeLine = 'hover'; + break; + case 'inline': + return; + } + } + const offset = this._uri.offset; const config = { @@ -234,7 +248,7 @@ export default class BlameStatusBarController extends Disposable { const hoverMessage = BlameAnnotationFormatter.getAnnotationHover(config, blameLine, logCommit || commit); let decorationOptions: DecorationOptions; - switch (this._config.blame.annotation.activeLine) { + switch (activeLine) { case 'both': decorationOptions = { range: editor.document.validateRange(new Range(blameLine.line + offset, 0, blameLine.line + offset, 1000000)),