Skip to content

Commit 809694d

Browse files
committed
feat: improve quickfix action
1 parent 0bbe00c commit 809694d

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

builtin/action/quickfix.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ export type QuickfixOptions = {
4040
* Command to execute after setting the quickfix list.
4141
*/
4242
after?: string;
43+
/**
44+
* Whether to keep the picker window open after setting the quickfix list.
45+
*/
46+
continue?: boolean;
4347
};
4448

4549
/**
@@ -53,7 +57,7 @@ export function quickfix(
5357
): Action<Detail> {
5458
const what = options.what ?? {};
5559
const action = options.action ?? " ";
56-
const after = options.after ?? "copen";
60+
const after = options.after ?? "";
5761

5862
return defineAction<Detail>(
5963
async (denops, { selectedItems, filteredItems }, { signal }) => {
@@ -85,6 +89,9 @@ export function quickfix(
8589
signal?.throwIfAborted();
8690
await denops.cmd(after);
8791
}
92+
if (options.continue) {
93+
return true;
94+
}
8895
},
8996
);
9097
}
@@ -94,6 +101,8 @@ export function quickfix(
94101
*/
95102
export const defaultQuickfixActions: {
96103
quickfix: Action<Detail>;
104+
"quickfix:copen": Action<Detail>;
97105
} = {
98-
quickfix: quickfix(),
106+
quickfix: quickfix({ continue: true }),
107+
"quickfix:copen": quickfix({ after: "copen" }),
99108
};

0 commit comments

Comments
 (0)