9
9
--- @field label_trailing_slash boolean
10
10
--- @field get_cwd fun ( context : blink.cmp.Context ): string
11
11
--- @field show_hidden_files_by_default boolean
12
+ --- @field ignore_root_slash boolean
12
13
13
14
--- @class blink.cmp.Source
14
15
--- @field opts blink.cmp.PathOpts
@@ -23,12 +24,14 @@ function path.new(opts)
23
24
label_trailing_slash = true ,
24
25
get_cwd = function (context ) return vim .fn .expand ((' #%d:p:h' ):format (context .bufnr )) end ,
25
26
show_hidden_files_by_default = false ,
27
+ ignore_root_slash = false ,
26
28
})
27
29
require (' blink.cmp.config.utils' ).validate (' sources.providers.path' , {
28
30
trailing_slash = { opts .trailing_slash , ' boolean' },
29
31
label_trailing_slash = { opts .label_trailing_slash , ' boolean' },
30
32
get_cwd = { opts .get_cwd , ' function' },
31
33
show_hidden_files_by_default = { opts .show_hidden_files_by_default , ' boolean' },
34
+ ignore_root_slash = { opts .ignore_root_slash , ' boolean' },
32
35
}, opts )
33
36
34
37
self .opts = opts
@@ -43,7 +46,7 @@ function path:get_completions(context, callback)
43
46
44
47
local lib = require (' blink.cmp.sources.path.lib' )
45
48
46
- local dirname = lib .dirname (self .opts . get_cwd , context )
49
+ local dirname = lib .dirname (self .opts , context )
47
50
if not dirname then return callback ({ is_incomplete_forward = false , is_incomplete_backward = false , items = {} }) end
48
51
49
52
local include_hidden = self .opts .show_hidden_files_by_default
0 commit comments