diff --git a/denops/gin/util/ensure_path.ts b/denops/gin/util/ensure_path.ts index ac1e9ab0..2bacc39a 100644 --- a/denops/gin/util/ensure_path.ts +++ b/denops/gin/util/ensure_path.ts @@ -15,7 +15,7 @@ export async function ensurePath( denops: Denops, path?: string, ): Promise { - const bufname = await fn.expand(denops, path ?? "%") as string; - const abspath = await fn.fnamemodify(denops, bufname, ":p"); + const expr = path ?? await fn.bufname(denops); + const abspath = await fn.fnamemodify(denops, expr, ":p"); return abspath; }