Skip to content

Commit 832784a

Browse files
committed
Allow auto completion for complex dir structures
1 parent 1b44530 commit 832784a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

script/core/completion/completion.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,10 +369,11 @@ local function checkModule(state, word, position, results)
369369
for _, sr in ipairs(infos) do
370370
local pattern = sr.searcher
371371
:gsub("(%p)", "%%%1")
372-
:gsub("%%%?", "([%%a_][%%w_]*)")
372+
:gsub("%%%?", "(.-)")
373373

374374
local stemName = relativePath
375375
:match(pattern)
376+
:match("[%a_][%w_]*$")
376377

377378
if not stemName or testedStem[stemName] then
378379
goto INNER_CONTINUE
@@ -382,7 +383,6 @@ local function checkModule(state, word, position, results)
382383
if not locals[stemName]
383384
and not vm.hasGlobalSets(state.uri, 'variable', stemName)
384385
and not globals[stemName]
385-
and stemName:match '^[%a_][%w_]*$'
386386
and matchKey(word, stemName) then
387387
local targetState = files.getState(uri)
388388
if not targetState then

0 commit comments

Comments
 (0)