Skip to content

Commit 6186ac2

Browse files
authored
Merge pull request #3 from kuuote/fix-lock_base_path
fix: don't lock base path at `grep` and `rg` Curators
2 parents 87e42ff + 3a85e0d commit 6186ac2

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

builtin/curator/grep.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,10 @@ const pattern = new RegExp("^(.*?):(\\d+):(.*)$");
4040
* @returns A Curator that yields search results in the form of `GrepDetail`.
4141
*/
4242
export function grep(options: GrepOptions = {}): Curator<Detail> {
43-
let base: string;
4443
return defineCurator(
4544
async function* (denops, { args, query }, { signal }) {
4645
// Determine the root directory for the grep command
47-
base ??= await getAbsolutePathOf(denops, args[0] ?? ".", signal);
46+
const base = await getAbsolutePathOf(denops, args[0] ?? ".", signal);
4847

4948
// Configure the `grep` command with the provided query
5049
const cmd = new Deno.Command("grep", {

builtin/curator/rg.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,10 @@ const pattern = new RegExp("^(.*?):(\\d+):(\\d+):(.*)$");
3838
* @returns A Curator that yields search results in the form of `RgDetail`.
3939
*/
4040
export function rg(options: RgOptions = {}): Curator<Detail> {
41-
let base: string;
4241
return defineCurator(
4342
async function* (denops, { args, query }, { signal }) {
4443
// Determine the root directory for the rg command
45-
base ??= await getAbsolutePathOf(denops, args[0] ?? ".", signal);
44+
const base = await getAbsolutePathOf(denops, args[0] ?? ".", signal);
4645

4746
// Configure the `rg` command with the provided query
4847
const cmd = new Deno.Command("rg", {

0 commit comments

Comments
 (0)