Skip to content

Commit

Permalink
feat: Added config option to choose changes left click command (#417)
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnstonCode committed Nov 19, 2018
1 parent 8ac4144 commit dc661cc
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
9 changes: 9 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,15 @@
"type": "boolean",
"description": "Refresh remote changes on refresh command",
"default": false
},
"svn.sourceControl.changesLeftClick": {
"type": "string",
"enum": [
"open",
"open diff"
],
"description": "Set left click functionality on changes resource state",
"default": "open diff"
}
}
}
Expand Down
12 changes: 12 additions & 0 deletions src/resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,18 @@ export class Resource implements SourceControlResourceState {
@memoize
get command(): Command {
const diffHead = configuration.get<boolean>("diff.withHead", true);
const changesLeftClick = configuration.get<string>(
"sourceControl.changesLeftClick",
"open diff"
);

if (!this.remote && changesLeftClick === "open") {
return {
command: "svn.openFile",
title: "Open file",
arguments: [this]
};
}

if (this.remote || diffHead) {
return {
Expand Down

0 comments on commit dc661cc

Please sign in to comment.