Skip to content

Commit 6ea5336

Browse files
authored
Add trailingSlashAbbr param (#11)
* Add trailingSlashAbbr param * Make it default
1 parent d6caba9 commit 6ea5336

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

denops/@ddc-sources/file.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ type Params = {
2121
bufAsRoot: boolean;
2222
projAsRoot: boolean;
2323
trailingSlash: boolean;
24+
trailingSlashAbbr: boolean;
2425
followSymlinks: boolean;
2526
disableMenu: boolean;
2627

@@ -239,6 +240,8 @@ export class Source extends BaseSource<Params> {
239240
.map(({ name, isDirectory, isSymlink }): Candidate => ({
240241
word: name.slice(inputFileBasePrefix.length) +
241242
(p.trailingSlash && isDirectory ? path.sep : ""),
243+
abbr: name.slice(inputFileBasePrefix.length) +
244+
(p.trailingSlashAbbr && isDirectory ? path.sep : ""),
242245
menu: p.disableMenu
243246
? undefined
244247
: (menu !== "" && isInputAbs ? path.sep : "") + menu,
@@ -278,6 +281,7 @@ export class Source extends BaseSource<Params> {
278281
bufAsRoot: false,
279282
projAsRoot: true,
280283
trailingSlash: false,
284+
trailingSlashAbbr: true,
281285
followSymlinks: false,
282286
disableMenu: false,
283287

doc/ddc-file.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,13 @@ trailingSlash (boolean)
164164

165165
Default: false
166166

167+
*ddc-file-params-trailingSlashAbbr*
168+
trailingSlashAbbr (boolean)
169+
Whether to display trailing slash when completing directory
170+
name. Note that this won't be actually inserted.
171+
172+
Default: true
173+
167174
*ddc-file-params-followSymlinks*
168175
followSymlinks (boolean)
169176
Whether to follow symlinks to determine whether the filename

0 commit comments

Comments
 (0)