Skip to content

Commit 6a5cf05

Browse files
committed
fix: path completions
1 parent 7041f93 commit 6a5cf05

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lua/blink/cmp/sources/path/lib.lua

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
local lib = {}
22

33
--- @param path_regex vim.regex
4-
--- @param get_cwd fun(context: blink.cmp.CompletionContext): string
5-
--- @param context blink.cmp.CompletionContext
4+
--- @param get_cwd fun(context: blink.cmp.Context): string
5+
--- @param context blink.cmp.Context
66
function lib.dirname(path_regex, get_cwd, context)
77
local line_before_cursor = context.line:sub(1, context.cursor[2])
88
local s = path_regex:match_str(line_before_cursor)
@@ -34,7 +34,7 @@ function lib.dirname(path_regex, get_cwd, context)
3434
-- Ignore math calculation
3535
accept = accept and not prefix:match('[%d%)]%s*/$')
3636
-- Ignore / comment
37-
accept = accept and (not prefix:match('^[%s/]*$') or not self:_is_slash_comment())
37+
accept = accept and (not prefix:match('^[%s/]*$') or not lib.is_slash_comment())
3838
if accept then return vim.fn.resolve('/' .. dirname) end
3939
end
4040
return nil
@@ -55,7 +55,7 @@ function lib.candidates(dirname, include_hidden, opts)
5555
end)
5656
end
5757

58-
function lib.is_slash_comment(_)
58+
function lib.is_slash_comment()
5959
local commentstring = vim.bo.commentstring or ''
6060
local no_filetype = vim.bo.filetype == ''
6161
local is_slash_comment = false

0 commit comments

Comments
 (0)