Skip to content

Commit fdce4be

Browse files
author
neo451
committed
tmp
1 parent b31c2ba commit fdce4be

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

lua/obsidian/lsp/handlers/completion.lua

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ local handle_bare_links = function(prefix, notes, range, handler)
171171
local matches = vim.fn.matchfuzzy(queries, pattern, { limit = 10 }) -- TOOD: config? lower?
172172

173173
if auto then
174-
local note = note_lookup[matches[1]]
175-
if note then
174+
if not vim.tbl_isempty(matches) then
175+
local note = note_lookup[matches[1]]
176176
auto_accept(note, range)
177177
end
178178
else
@@ -265,10 +265,7 @@ handlers[CmpType.ref] = function(prefix, range, handler)
265265

266266
local notes = Search.find_notes(prefix, {
267267
search = search_opts,
268-
notes = {
269-
collect_anchor_links = anchor_link ~= nil,
270-
collect_blocks = block_link ~= nil,
271-
},
268+
notes = { collect_anchor_links = anchor_link ~= nil, collect_blocks = block_link ~= nil },
272269
})
273270

274271
if #notes == 0 then

0 commit comments

Comments
 (0)