mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-01-15 17:25:33 -05:00
Adds config setting to control quickpick closing
This commit is contained in:
@@ -299,6 +299,11 @@
|
||||
],
|
||||
"description": "Specifies how much (if any) output will be sent to the GitLens output channel"
|
||||
},
|
||||
"gitlens.advanced.quickPick.closeOnFocusOut": {
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"description": "Specifies whether or not to close the QuickPick menu when focus is lost"
|
||||
},
|
||||
"gitlens.advanced.toggleWhitespace.enabled": {
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
|
||||
@@ -1,12 +1,17 @@
|
||||
'use strict';
|
||||
import { Iterables } from '../system';
|
||||
import { QuickPickOptions, Uri, window } from 'vscode';
|
||||
import { QuickPickOptions, Uri, window, workspace } from 'vscode';
|
||||
import { IAdvancedConfig } from '../configuration';
|
||||
import { Commands } from '../constants';
|
||||
import { GitCommit, GitUri, IGitLog } from '../gitProvider';
|
||||
import { CommandQuickPickItem, CommitQuickPickItem, FileQuickPickItem } from './quickPickItems';
|
||||
import * as moment from 'moment';
|
||||
import * as path from 'path';
|
||||
|
||||
function getQuickPickIgnoreFocusOut() {
|
||||
return !workspace.getConfiguration('gitlens').get<IAdvancedConfig>('advanced').quickPick.closeOnFocusOut;
|
||||
}
|
||||
|
||||
export class CommitQuickPick {
|
||||
|
||||
static async show(commit: GitCommit, workingFileName: string, uri: Uri, currentCommand?: CommandQuickPickItem, goBackCommand?: CommandQuickPickItem, options: { showFileHistory?: boolean } = {}): Promise<CommandQuickPickItem | undefined> {
|
||||
@@ -59,7 +64,8 @@ export class CommitQuickPick {
|
||||
|
||||
return await window.showQuickPick(items, {
|
||||
matchOnDescription: true,
|
||||
placeHolder: `${commit.fileName} \u2022 ${commit.sha} \u2022 ${commit.author}, ${moment(commit.date).fromNow()} \u2022 ${commit.message}`
|
||||
placeHolder: `${commit.fileName} \u2022 ${commit.sha} \u2022 ${commit.author}, ${moment(commit.date).fromNow()} \u2022 ${commit.message}`,
|
||||
ignoreFocusOut: getQuickPickIgnoreFocusOut()
|
||||
} as QuickPickOptions);
|
||||
}
|
||||
}
|
||||
@@ -79,7 +85,8 @@ export class CommitFilesQuickPick {
|
||||
return await window.showQuickPick(items, {
|
||||
matchOnDescription: true,
|
||||
matchOnDetail: true,
|
||||
placeHolder: `${commit.sha} \u2022 ${commit.author}, ${moment(commit.date).fromNow()} \u2022 ${commit.message}`
|
||||
placeHolder: `${commit.sha} \u2022 ${commit.author}, ${moment(commit.date).fromNow()} \u2022 ${commit.message}`,
|
||||
ignoreFocusOut: getQuickPickIgnoreFocusOut()
|
||||
} as QuickPickOptions);
|
||||
}
|
||||
}
|
||||
@@ -116,7 +123,8 @@ export class FileCommitsQuickPick {
|
||||
return await window.showQuickPick(items, {
|
||||
matchOnDescription: true,
|
||||
matchOnDetail: true,
|
||||
placeHolder: `${Iterables.first(log.commits.values()).fileName}`
|
||||
placeHolder: `${Iterables.first(log.commits.values()).fileName}`,
|
||||
ignoreFocusOut: getQuickPickIgnoreFocusOut()
|
||||
} as QuickPickOptions);
|
||||
}
|
||||
}
|
||||
@@ -141,7 +149,8 @@ export class RepoCommitsQuickPick {
|
||||
return await window.showQuickPick(items, {
|
||||
matchOnDescription: true,
|
||||
matchOnDetail: true,
|
||||
placeHolder: 'Search by commit message, filename, or sha'
|
||||
placeHolder: 'Search by commit message, filename, or sha',
|
||||
ignoreFocusOut: getQuickPickIgnoreFocusOut()
|
||||
} as QuickPickOptions);
|
||||
}
|
||||
}
|
||||
@@ -109,6 +109,9 @@ export interface IAdvancedConfig {
|
||||
output: {
|
||||
level: OutputLevel;
|
||||
};
|
||||
quickPick: {
|
||||
closeOnFocusOut: boolean;
|
||||
};
|
||||
toggleWhitespace: {
|
||||
enabled: boolean;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user