Skip to content

Commit

Permalink
Initialize context path
Browse files Browse the repository at this point in the history
  • Loading branch information
Shougo committed Jun 4, 2024
1 parent a77be8b commit d801d73
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion denops/ddu/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -337,13 +337,16 @@ export class ContextBuilder {
);
}

const cwd = await fn.getcwd(denops);

return [
{
...defaultContext(),
bufName: await fn.bufname(denops, "%"),
bufNr: await fn.bufnr(denops, "%"),
cwd: await fn.getcwd(denops),
cwd,
mode: await fn.mode(denops),
path: cwd,
winId: await fn.win_getid(denops) as number,
},
userOptions,
Expand Down
4 changes: 2 additions & 2 deletions denops/ddu/ddu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -449,10 +449,10 @@ export class Ddu {
sourceOptions,
);

// Get path option, or current directory instead if it is empty.
// Get path option or context path directory instead if it is empty.
const path = sourceOptions.path.length > 0
? sourceOptions.path
: await fn.getcwd(denops);
: this.#context.path;

for await (const newItems of itemsStream) {
if (!equal(path, this.#context.path)) {
Expand Down

0 comments on commit d801d73

Please sign in to comment.