From 7bd929049fdc5503c71a01a086b1886e63a88860 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Wed, 1 May 2019 04:33:54 -0400 Subject: [PATCH] Closes #728 - Adds advanced.maxSearchItems --- README.md | 1 + package.json | 6 ++++++ src/commands/searchCommits.ts | 6 +----- src/config.ts | 1 + src/git/gitService.ts | 2 +- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 6135fd4..a323099 100644 --- a/README.md +++ b/README.md @@ -848,6 +848,7 @@ See also [View Settings](#view-settings- 'Jump to the View settings') | `gitlens.advanced.caching.enabled` | Specifies whether git output will be cached — changing the default is not recommended | | `gitlens.advanced.fileHistoryFollowsRenames` | Specifies whether file histories will follow renames -- will affect how merge commits are shown in histories | | `gitlens.advanced.maxListItems` | Specifies the maximum number of items to show in a list. Use 0 to specify no maximum | +| `gitlens.advanced.maxSearchItems` | Specifies the maximum number of items to show in a search. Use 0 to specify no maximum | | `gitlens.advanced.messages` | Specifies which messages should be suppressed | | `gitlens.advanced.quickPick.closeOnFocusOut` | Specifies whether to close QuickPick menus when focus is lost | | `gitlens.advanced.repositorySearchDepth` | Specifies how many folders deep to search for repositories | diff --git a/package.json b/package.json index ed96a2f..23eb97d 100644 --- a/package.json +++ b/package.json @@ -1668,6 +1668,12 @@ "markdownDescription": "Specifies the maximum number of items to show in a list. Use 0 to specify no maximum", "scope": "window" }, + "gitlens.advanced.maxSearchItems": { + "type": "number", + "default": 200, + "markdownDescription": "Specifies the maximum number of items to show in a search. Use 0 to specify no maximum", + "scope": "window" + }, "gitlens.advanced.messages": { "type": "object", "default": { diff --git a/src/commands/searchCommits.ts b/src/commands/searchCommits.ts index c4c2bdf..ade579a 100644 --- a/src/commands/searchCommits.ts +++ b/src/commands/searchCommits.ts @@ -39,7 +39,6 @@ const searchByToSymbolMap = new Map([ export interface SearchCommitsCommandArgs { search?: string; searchBy?: GitRepoSearchBy; - maxCount?: number; prefillOnly?: boolean; showInView?: boolean; @@ -177,7 +176,6 @@ export class SearchCommitsCommand extends ActiveEditorCachedCommand { if (args.showInView) { void Container.searchView.search(repoPath, args.search, args.searchBy, { - maxCount: args.maxCount, label: { label: searchLabel! } }); @@ -186,9 +184,7 @@ export class SearchCommitsCommand extends ActiveEditorCachedCommand { const progressCancellation = CommitsQuickPick.showProgress(searchLabel!); try { - const log = await Container.git.getLogForSearch(repoPath, args.search, args.searchBy, { - maxCount: args.maxCount - }); + const log = await Container.git.getLogForSearch(repoPath, args.search, args.searchBy); if (progressCancellation.token.isCancellationRequested) return undefined; diff --git a/src/config.ts b/src/config.ts index 2e27d5f..5ddc90c 100644 --- a/src/config.ts +++ b/src/config.ts @@ -205,6 +205,7 @@ export interface AdvancedConfig { }; fileHistoryFollowsRenames: boolean; maxListItems: number; + maxSearchItems: number; messages: { suppressCommitHasNoPreviousCommitWarning: boolean; suppressCommitNotFoundWarning: boolean; diff --git a/src/git/gitService.ts b/src/git/gitService.ts index 8cca575..3a90e70 100644 --- a/src/git/gitService.ts +++ b/src/git/gitService.ts @@ -1441,7 +1441,7 @@ export class GitService implements Disposable { searchBy: GitRepoSearchBy, options: { maxCount?: number } = {} ): Promise { - let maxCount = options.maxCount == null ? Container.config.advanced.maxListItems || 0 : options.maxCount; + let maxCount = options.maxCount == null ? Container.config.advanced.maxSearchItems || 0 : options.maxCount; const similarityThreshold = Container.config.advanced.similarityThreshold; let searchArgs: string[] | undefined = undefined;