diff --git a/file-search/launcher.luau b/file-search/launcher.luau index cb591dd..f73e88a 100644 --- a/file-search/launcher.luau +++ b/file-search/launcher.luau @@ -155,7 +155,15 @@ local function buildIndex(query) local queued = pendingQuery pendingQuery = nil if result.exitCode == 0 and not result.timedOut then - runQuery(queued or query) + if indexKey() ~= key then + -- Settings changed while the walk was running: the cache + -- holds paths relative to the old root, and activation + -- would join them to the new one. Rebuild instead of + -- searching stale records (mirrors the panel). + buildIndex(queued or query) + else + runQuery(queued or query) + end else launcher.setResults(queued or query, { noopRow("err_index") }) end diff --git a/file-search/plugin.toml b/file-search/plugin.toml index 1d690c6..f887d12 100644 --- a/file-search/plugin.toml +++ b/file-search/plugin.toml @@ -6,7 +6,7 @@ id = "nightwatch75/file-search" name = "File Search" -version = "0.0.9" +version = "0.0.10" plugin_api = 3 author = "nightwatch75" license = "MIT"