diff --git a/package.json b/package.json index b0962113..9d1f9e3f 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "compile": "node ./node_modules/vscode/bin/compile -watch -p ./" }, "dependencies": { - "git-blame": "^0.1.1", + "git-blame": "^1.1.0", "moment": "^2.10.6", "path": "^0.12.7", "typescript": "^1.6.2", @@ -46,6 +46,16 @@ "commands": [{ "command": "extension.blame", "title": "Git Blame" - }] + }], + "configuration": { + "title": "Git Blame configuration", + "properties": { + "git-blame.ignore-whitespace-change":{ + "type": "boolean", + "default": true, + "description" : "If set to true, git blame command will ignore any whitespace change applied to currently selected line" + } + } + } } } diff --git a/src/gitblame.ts b/src/gitblame.ts index 86a77be4..78741cbd 100644 --- a/src/gitblame.ts +++ b/src/gitblame.ts @@ -1,4 +1,4 @@ - +import * as vscode from 'vscode'; export class GitBlame { @@ -38,7 +38,8 @@ export class GitBlame { }; self.gitBlameProcess(repo, { - file: fileName + file: fileName, + ignoreWhitespaces: vscode.workspace.getConfiguration('git-blame').get("ignore-whitespace-change", true) }).on('data', (type, data) => { // outputs in Porcelain format. if (type === 'line') {