提交 97e4c809 编写于 作者: R Rob Lourens

Don't try to search when no folders are open

上级 3cc9994b
......@@ -41,6 +41,14 @@ export class RipgrepEngine {
// TODO@Rob - make promise-based once the old search is gone, and I don't need them to have matching interfaces anymore
search(onResult: (match: ISerializedFileMatch) => void, onMessage: (message: ISearchLog) => void, done: (error: Error, complete: ISerializedSearchComplete) => void): void {
if (!this.config.folderQueries.length) {
done(null, {
limitHit: false,
stats: null
});
return;
}
const rgArgs = getRgArgs(this.config);
if (rgArgs.siblingClauses) {
this.postProcessExclusions = glob.parseToAsync(rgArgs.siblingClauses, { trimForExclusions: true });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册