mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-02-15 10:58:36 -05:00
Allows toggle CodeLens command to work when set to auto
This commit is contained in:
@@ -62,13 +62,6 @@ export class BlameActiveLineController extends Disposable {
|
|||||||
changed = true;
|
changed = true;
|
||||||
if (config.statusBar.enabled) {
|
if (config.statusBar.enabled) {
|
||||||
this._statusBarItem = this._statusBarItem || window.createStatusBarItem(StatusBarAlignment.Right, 1000);
|
this._statusBarItem = this._statusBarItem || window.createStatusBarItem(StatusBarAlignment.Right, 1000);
|
||||||
switch (config.statusBar.command) {
|
|
||||||
case StatusBarCommand.ToggleCodeLens:
|
|
||||||
if (config.codeLens.visibility !== 'ondemand') {
|
|
||||||
config.statusBar.command = StatusBarCommand.BlameAnnotate;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
this._statusBarItem.command = config.statusBar.command;
|
this._statusBarItem.command = config.statusBar.command;
|
||||||
}
|
}
|
||||||
else if (!config.statusBar.enabled && this._statusBarItem) {
|
else if (!config.statusBar.enabled && this._statusBarItem) {
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ export class GitService extends Disposable {
|
|||||||
this._codeLensProvider = undefined;
|
this._codeLensProvider = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
setCommandContext(CommandContext.CanToggleCodeLens, config.codeLens.visibility === CodeLensVisibility.OnDemand && (config.codeLens.recentChange.enabled || config.codeLens.authors.enabled));
|
setCommandContext(CommandContext.CanToggleCodeLens, config.codeLens.visibility !== CodeLensVisibility.Off && (config.codeLens.recentChange.enabled || config.codeLens.authors.enabled));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (advancedChanged) {
|
if (advancedChanged) {
|
||||||
@@ -827,11 +827,10 @@ export class GitService extends Disposable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
toggleCodeLens(editor: TextEditor) {
|
toggleCodeLens(editor: TextEditor) {
|
||||||
if (this.config.codeLens.visibility !== CodeLensVisibility.OnDemand ||
|
if (this.config.codeLens.visibility === CodeLensVisibility.Off ||
|
||||||
(!this.config.codeLens.recentChange.enabled && !this.config.codeLens.authors.enabled)) return;
|
(!this.config.codeLens.recentChange.enabled && !this.config.codeLens.authors.enabled)) return;
|
||||||
|
|
||||||
Logger.log(`toggleCodeLens(${editor})`);
|
Logger.log(`toggleCodeLens()`);
|
||||||
|
|
||||||
if (this._codeLensProviderDisposable) {
|
if (this._codeLensProviderDisposable) {
|
||||||
this._codeLensProviderDisposable.dispose();
|
this._codeLensProviderDisposable.dispose();
|
||||||
this._codeLensProviderDisposable = undefined;
|
this._codeLensProviderDisposable = undefined;
|
||||||
|
|||||||
Reference in New Issue
Block a user