We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 88d3c5a commit 71188a1Copy full SHA for 71188a1
builtin/previewer/file.ts
@@ -9,6 +9,7 @@ const decoder = new TextDecoder("utf-8", { fatal: true });
9
10
type Detail = {
11
path: string;
12
+ preview_path?: string;
13
line?: number;
14
column?: number;
15
};
@@ -23,10 +24,12 @@ type Detail = {
23
24
*/
25
export function file(): Previewer<Detail> {
26
return definePreviewer(async (denops, { item }, { signal }) => {
27
+ const path = item.detail.preview_path ?? item.detail.path;
28
+
29
// Resolve the absolute path of the file
- const abspath = isAbsolute(item.detail.path)
- ? item.detail.path
- : await fn.fnamemodify(denops, item.detail.path, ":p");
30
+ const abspath = isAbsolute(path)
31
+ ? path
32
+ : await fn.fnamemodify(denops, path, ":p");
33
signal?.throwIfAborted();
34
35
try {
0 commit comments