core: prevent file system scanning when in root directory to avoid unnecessary operations
This commit is contained in:
parent
5720ed1f44
commit
d8a34c2fcc
1 changed files with 2 additions and 0 deletions
|
|
@ -125,6 +125,8 @@ export namespace File {
|
||||||
let cache: Entry = { files: [], dirs: [] }
|
let cache: Entry = { files: [], dirs: [] }
|
||||||
let fetching = false
|
let fetching = false
|
||||||
const fn = async (result: Entry) => {
|
const fn = async (result: Entry) => {
|
||||||
|
// Disable scanning if in root of file system
|
||||||
|
if (Instance.directory === path.parse(Instance.directory).root) return
|
||||||
fetching = true
|
fetching = true
|
||||||
const set = new Set<string>()
|
const set = new Set<string>()
|
||||||
for await (const file of Ripgrep.files({ cwd: Instance.directory })) {
|
for await (const file of Ripgrep.files({ cwd: Instance.directory })) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue