Browse Source

Allows search to include details

main
Eric Amodio 5 years ago
parent
commit
22598e83c6
4 changed files with 28 additions and 23 deletions
  1. +1
    -0
      src/commands/git/cherry-pick.ts
  2. +1
    -0
      src/commands/git/merge.ts
  3. +1
    -0
      src/commands/git/rebase.ts
  4. +25
    -23
      src/commands/git/stash.ts

+ 1
- 0
src/commands/git/cherry-pick.ts View File

@ -136,6 +136,7 @@ export class CherryPickGitCommand extends QuickCommandBase {
log === undefined log === undefined
? `${state.source.name} has no pickable commits` ? `${state.source.name} has no pickable commits`
: `Choose commits to cherry-pick onto ${state.destination.name}`, : `Choose commits to cherry-pick onto ${state.destination.name}`,
matchOnDescription: true,
items: items:
log === undefined log === undefined
? [ ? [

+ 1
- 0
src/commands/git/merge.ts View File

@ -82,6 +82,7 @@ export class MergeGitCommand extends QuickCommandBase {
state.repo.formattedName state.repo.formattedName
}`, }`,
placeholder: `Choose a branch or tag to merge into ${state.destination.name}`, placeholder: `Choose a branch or tag to merge into ${state.destination.name}`,
matchOnDescription: true,
items: await getBranchesAndOrTags(state.repo, true, { items: await getBranchesAndOrTags(state.repo, true, {
filterBranches: b => b.id !== destId, filterBranches: b => b.id !== destId,
picked: state.source && state.source.ref picked: state.source && state.source.ref

+ 1
- 0
src/commands/git/rebase.ts View File

@ -82,6 +82,7 @@ export class RebaseGitCommand extends QuickCommandBase {
state.repo.formattedName state.repo.formattedName
}`, }`,
placeholder: `Choose a branch or tag to rebase ${state.destination.name} with`, placeholder: `Choose a branch or tag to rebase ${state.destination.name} with`,
matchOnDescription: true,
items: await getBranchesAndOrTags(state.repo, true, { items: await getBranchesAndOrTags(state.repo, true, {
filterBranches: b => b.id !== destId, filterBranches: b => b.id !== destId,
picked: state.source && state.source.ref picked: state.source && state.source.ref

+ 25
- 23
src/commands/git/stash.ts View File

@ -270,6 +270,7 @@ export class StashGitCommand extends QuickCommandBase {
stash === undefined stash === undefined
? `${state.repo.formattedName} has no stashed changes` ? `${state.repo.formattedName} has no stashed changes`
: 'Choose a stash to apply to your working tree', : 'Choose a stash to apply to your working tree',
matchOnDetail: true,
items: items:
stash === undefined stash === undefined
? [ ? [
@ -372,6 +373,7 @@ export class StashGitCommand extends QuickCommandBase {
stash === undefined stash === undefined
? `${state.repo.formattedName} has no stashed changes` ? `${state.repo.formattedName} has no stashed changes`
: 'Choose a stash to delete', : 'Choose a stash to delete',
matchOnDetail: true,
items: items:
stash === undefined stash === undefined
? [ ? [
@ -388,7 +390,7 @@ export class StashGitCommand extends QuickCommandBase {
} }
) )
) )
]
]
}); });
const selection = yield step; const selection = yield step;
@ -400,29 +402,29 @@ export class StashGitCommand extends QuickCommandBase {
} }
// if (this.confirm(state.confirm)) { // if (this.confirm(state.confirm)) {
const message =
state.stash.message.length > 80
? `${state.stash.message.substring(0, 80)}${GlyphChars.Ellipsis}`
: state.stash.message;
const step = this.createConfirmStep<QuickPickItem>(
`Confirm ${this.title} ${state.subcommand}${Strings.pad(GlyphChars.Dot, 2, 2)}${
state.repo.formattedName
}`,
[
{
label: `${this.title} ${state.subcommand}`,
description: `${state.stash.stashName}${Strings.pad(GlyphChars.Dash, 2, 2)}${message}`,
detail: `Will delete ${state.stash.stashName}`
}
],
{ placeholder: `Confirm ${this.title} ${state.subcommand}` }
);
const selection = yield step;
const message =
state.stash.message.length > 80
? `${state.stash.message.substring(0, 80)}${GlyphChars.Ellipsis}`
: state.stash.message;
const step = this.createConfirmStep<QuickPickItem>(
`Confirm ${this.title} ${state.subcommand}${Strings.pad(GlyphChars.Dot, 2, 2)}${
state.repo.formattedName
}`,
[
{
label: `${this.title} ${state.subcommand}`,
description: `${state.stash.stashName}${Strings.pad(GlyphChars.Dash, 2, 2)}${message}`,
detail: `Will delete ${state.stash.stashName}`
}
],
{ placeholder: `Confirm ${this.title} ${state.subcommand}` }
);
const selection = yield step;
if (!this.canMoveNext(step, state, selection)) {
break;
}
if (!this.canMoveNext(step, state, selection)) {
break;
}
// } // }
void Container.git.stashDelete(state.repo.path, state.stash.stashName); void Container.git.stashDelete(state.repo.path, state.stash.stashName);

Loading…
Cancel
Save