Skip to content
This repository was archived by the owner on Oct 13, 2021. It is now read-only.

Commit 49a2335

Browse files
committed
fix: broken auto changing source
1 parent 81ec73b commit 49a2335

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lua/completion/source.lua

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,14 +165,18 @@ function M.autoCompletion(manager)
165165
end
166166
M.prefixLength = #prefix
167167

168-
-- force reset chain completion and clear completion cache if entering a new word
169-
if (#prefix <= length) then
168+
-- force reset chain completion
169+
if (#prefix < length) then
170170
complete.clearCache()
171171
M.chain_complete_index = 1
172172
M.stop_complete = false
173173
manager.changeSource = false
174174
end
175175

176+
if (#prefix == 0) then
177+
complete.clearCache()
178+
end
179+
176180
-- stop auto completion when all sources return no complete-items
177181
if M.stop_complete == true then return end
178182

0 commit comments

Comments
 (0)