From 175a3854242f7dd43d706e2e0acc4f08ab1ed9ee Mon Sep 17 00:00:00 2001 From: hrsh7th Date: Tue, 10 Aug 2021 03:21:32 +0900 Subject: [PATCH] Fix filename completion --- lua/cmp_path/init.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/cmp_path/init.lua b/lua/cmp_path/init.lua index 98e8213..2a22481 100644 --- a/lua/cmp_path/init.lua +++ b/lua/cmp_path/init.lua @@ -125,6 +125,7 @@ source._candidates = function(_, context, dirname, offset, callback) else table.insert(items, { label = name, + filterText = '/' .. name, insertText = '/' .. name, kind = cmp.lsp.CompletionItemKind.File, }) @@ -133,6 +134,7 @@ source._candidates = function(_, context, dirname, offset, callback) elseif type == 'file' then table.insert(items, { label = name, + filterText = '/' .. name, insertText = '/' .. name, kind = cmp.lsp.CompletionItemKind.File, })