mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-02-16 18:48:45 -05:00
Adds clipboard default into commit search
This commit is contained in:
@@ -5,6 +5,7 @@ import { GitRepoSearchBy, GitService, GitUri } from '../gitService';
|
|||||||
import { Logger } from '../logger';
|
import { Logger } from '../logger';
|
||||||
import { CommandQuickPickItem, CommitsQuickPick } from '../quickPicks';
|
import { CommandQuickPickItem, CommitsQuickPick } from '../quickPicks';
|
||||||
import { ShowQuickCommitDetailsCommandArgs } from './showQuickCommitDetails';
|
import { ShowQuickCommitDetailsCommandArgs } from './showQuickCommitDetails';
|
||||||
|
import { paste } from 'copy-paste';
|
||||||
|
|
||||||
const searchByRegex = /^([@:#])/;
|
const searchByRegex = /^([@:#])/;
|
||||||
const searchByMap = new Map<string, GitRepoSearchBy>([
|
const searchByMap = new Map<string, GitRepoSearchBy>([
|
||||||
@@ -34,6 +35,11 @@ export class ShowCommitSearchCommand extends ActiveEditorCachedCommand {
|
|||||||
if (gitUri.repoPath === undefined) return undefined;
|
if (gitUri.repoPath === undefined) return undefined;
|
||||||
|
|
||||||
if (!args.search || args.searchBy == null) {
|
if (!args.search || args.searchBy == null) {
|
||||||
|
if (!args.search) {
|
||||||
|
args.search = await new Promise<string>((resolve, reject) => {
|
||||||
|
paste((err: Error, content: string) => resolve(err ? '' : content));
|
||||||
|
});
|
||||||
|
}
|
||||||
args.search = await window.showInputBox({
|
args.search = await window.showInputBox({
|
||||||
value: args.search,
|
value: args.search,
|
||||||
prompt: `Please enter a search string`,
|
prompt: `Please enter a search string`,
|
||||||
|
|||||||
Reference in New Issue
Block a user