Changes behaviors when file has unsaved changes:

- Status bar blame information will hide
  - CodeLens change to a `Cannot determine...` message and become unclickable
  - Many menu choices and commands will hide
Fixes #36 - Blame information is invalid when a file has unsaved changes
Fixed #38 - Toggle Blame Annotation button shows even when it isn't valid
Preps v2.9.0
This commit is contained in:
Eric Amodio
2017-03-03 03:32:31 -05:00
parent d389a7b588
commit 1519898dfa
14 changed files with 325 additions and 141 deletions

View File

@@ -20,10 +20,12 @@ export class DiffLineWithPreviousCommand extends ActiveEditorCommand {
uri = editor.document.uri;
}
line = line ||(editor && editor.selection.active.line) || 0;
let gitUri = GitUri.fromUri(uri, this.git);
const gitUri = GitUri.fromUri(uri, this.git);
line = line || (editor && editor.selection.active.line) || gitUri.offset;
if (!commit || GitProvider.isUncommitted(commit.sha)) {
if (editor && editor.document && editor.document.isDirty) return undefined;
const blameline = line - gitUri.offset;
if (blameline < 0) return undefined;