Skip to content

Commit 0360a76

Browse files
ujihisaLumaKernel
andauthored
Fix filename completions on a nonexisting file outside your home directory (#12)
* Fix filename completions on a nonexisting file outside your home directory * Known issue: * It keeps the files at the previous directory too * Use @gamoutatsumi's approach * This part is written by Gamou Tatsumi * Thanks @Shougo! * #12 (comment) * `deno fmt` * Reuse the dir at findMarkers too * Thanks @LumaKernel #12 (comment) * Minor rename for variable Co-authored-by: Luma <world@luma.email>
1 parent 6ea5336 commit 0360a76

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

denops/@ddc-sources/file.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {
22
BaseSource,
33
Candidate,
4+
fn,
45
GatherCandidatesArguments,
56
homeDir,
67
path as univPath,
@@ -137,9 +138,11 @@ export class Source extends BaseSource<Params> {
137138
});
138139
}
139140

141+
const cwd = await fn.getcwd(args.denops) as string;
142+
140143
// point from cwd
141144
findPointsAsync.push({
142-
dir: Deno.cwd(),
145+
dir: cwd,
143146
max: p.cwdMaxCandidates,
144147
menu: p.displayCwd,
145148
asRoot: p.cwdAsRoot,
@@ -149,7 +152,7 @@ export class Source extends BaseSource<Params> {
149152
findPointsAsync.push(
150153
util.findMarkers(
151154
p.projFromCwdMaxCandidates.length,
152-
Deno.cwd(),
155+
cwd,
153156
p.projMarkers,
154157
path,
155158
)

0 commit comments

Comments
 (0)