Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions builtin/previewer/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

type Detail = {
path: string;
previewPath?: string;
line?: number;
column?: number;
};
Expand All @@ -23,10 +24,12 @@
*/
export function file(): Previewer<Detail> {
return definePreviewer(async (denops, { item }, { signal }) => {
const path = item.detail.previewPath ?? item.detail.path;

Check warning on line 27 in builtin/previewer/file.ts

View check run for this annotation

Codecov / codecov/patch

builtin/previewer/file.ts#L27

Added line #L27 was not covered by tests

// Resolve the absolute path of the file
const abspath = isAbsolute(item.detail.path)
? item.detail.path
: await fn.fnamemodify(denops, item.detail.path, ":p");
const abspath = isAbsolute(path)
? path
: await fn.fnamemodify(denops, path, ":p");

Check warning on line 32 in builtin/previewer/file.ts

View check run for this annotation

Codecov / codecov/patch

builtin/previewer/file.ts#L30-L32

Added lines #L30 - L32 were not covered by tests
signal?.throwIfAborted();

try {
Expand Down