Skip to content

Commit

Permalink
mhutchie#30 new option retainContextWhenHidden
Browse files Browse the repository at this point in the history
  • Loading branch information
yzhang-gh committed May 18, 2019
1 parent 4166cf9 commit efba6ec
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion package.json
Expand Up @@ -182,6 +182,11 @@
],
"default": "colour",
"description": "Specifies the colour theme of the icon displayed on the Git Graph tab."
},
"git-graph.retainContextWhenHidden": {
"type": "boolean",
"default": false,
"description": "Controls if the Git Graph View is kept around even when the panel is no longer visible (e.g. moved to background tab)."
}
}
}
Expand All @@ -204,4 +209,4 @@
"uglify-js": "^3.4.9",
"vscode": "^1.1.28"
}
}
}
4 changes: 4 additions & 0 deletions src/config.ts
Expand Up @@ -65,6 +65,10 @@ class Config {
return this.workspaceConfiguration.get('tabIconColourTheme', 'colour');
}

public retainContextWhenHidden(): boolean {
return this.workspaceConfiguration.get('retainContextWhenHidden', false);
}

public gitPath(): string {
let path = vscode.workspace.getConfiguration('git').get('path', null);
return path !== null ? path : 'git';
Expand Down
3 changes: 2 additions & 1 deletion src/gitGraphView.ts
Expand Up @@ -37,7 +37,8 @@ export class GitGraphView {
enableScripts: true,
localResourceRoots: [
vscode.Uri.file(path.join(extensionPath, 'media'))
]
],
retainContextWhenHidden: getConfig().retainContextWhenHidden()
});

GitGraphView.currentPanel = new GitGraphView(panel, extensionPath, dataSource, extensionState, avatarManager, repoManager);
Expand Down

0 comments on commit efba6ec

Please sign in to comment.