mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-02-16 10:58:34 -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"
|
"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": {
|
"gitlens.advanced.toggleWhitespace.enabled": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": false,
|
"default": false,
|
||||||
|
|||||||
@@ -1,12 +1,17 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
import { Iterables } from '../system';
|
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 { Commands } from '../constants';
|
||||||
import { GitCommit, GitUri, IGitLog } from '../gitProvider';
|
import { GitCommit, GitUri, IGitLog } from '../gitProvider';
|
||||||
import { CommandQuickPickItem, CommitQuickPickItem, FileQuickPickItem } from './quickPickItems';
|
import { CommandQuickPickItem, CommitQuickPickItem, FileQuickPickItem } from './quickPickItems';
|
||||||
import * as moment from 'moment';
|
import * as moment from 'moment';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
|
|
||||||
|
function getQuickPickIgnoreFocusOut() {
|
||||||
|
return !workspace.getConfiguration('gitlens').get<IAdvancedConfig>('advanced').quickPick.closeOnFocusOut;
|
||||||
|
}
|
||||||
|
|
||||||
export class CommitQuickPick {
|
export class CommitQuickPick {
|
||||||
|
|
||||||
static async show(commit: GitCommit, workingFileName: string, uri: Uri, currentCommand?: CommandQuickPickItem, goBackCommand?: CommandQuickPickItem, options: { showFileHistory?: boolean } = {}): Promise<CommandQuickPickItem | undefined> {
|
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, {
|
return await window.showQuickPick(items, {
|
||||||
matchOnDescription: true,
|
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);
|
} as QuickPickOptions);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -79,7 +85,8 @@ export class CommitFilesQuickPick {
|
|||||||
return await window.showQuickPick(items, {
|
return await window.showQuickPick(items, {
|
||||||
matchOnDescription: true,
|
matchOnDescription: true,
|
||||||
matchOnDetail: 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);
|
} as QuickPickOptions);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -116,7 +123,8 @@ export class FileCommitsQuickPick {
|
|||||||
return await window.showQuickPick(items, {
|
return await window.showQuickPick(items, {
|
||||||
matchOnDescription: true,
|
matchOnDescription: true,
|
||||||
matchOnDetail: true,
|
matchOnDetail: true,
|
||||||
placeHolder: `${Iterables.first(log.commits.values()).fileName}`
|
placeHolder: `${Iterables.first(log.commits.values()).fileName}`,
|
||||||
|
ignoreFocusOut: getQuickPickIgnoreFocusOut()
|
||||||
} as QuickPickOptions);
|
} as QuickPickOptions);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -141,7 +149,8 @@ export class RepoCommitsQuickPick {
|
|||||||
return await window.showQuickPick(items, {
|
return await window.showQuickPick(items, {
|
||||||
matchOnDescription: true,
|
matchOnDescription: true,
|
||||||
matchOnDetail: true,
|
matchOnDetail: true,
|
||||||
placeHolder: 'Search by commit message, filename, or sha'
|
placeHolder: 'Search by commit message, filename, or sha',
|
||||||
|
ignoreFocusOut: getQuickPickIgnoreFocusOut()
|
||||||
} as QuickPickOptions);
|
} as QuickPickOptions);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -109,6 +109,9 @@ export interface IAdvancedConfig {
|
|||||||
output: {
|
output: {
|
||||||
level: OutputLevel;
|
level: OutputLevel;
|
||||||
};
|
};
|
||||||
|
quickPick: {
|
||||||
|
closeOnFocusOut: boolean;
|
||||||
|
};
|
||||||
toggleWhitespace: {
|
toggleWhitespace: {
|
||||||
enabled: boolean;
|
enabled: boolean;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user