Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Added config option to choose changes left click command #417

Merged
merged 1 commit into from
Nov 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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