Fix: allow empty path in utils.get_at_path

This commit is contained in:
Stephan Seitz 2021-04-05 14:40:22 +02:00 committed by Stephan Seitz
parent 06c9ef8104
commit 826683b1bf
2 changed files with 4 additions and 6 deletions

View file

@ -189,14 +189,11 @@ function M.get_capture_matches(bufnr, capture_string, query_group, root, lang)
end
function M.find_best_match(bufnr, capture_string, query_group, filter_predicate, scoring_function, root)
if not string.sub(capture_string, 1,2) == '@' then
api.nvim_err_writeln('capture_string must start with "@"')
return
if string.sub(capture_string, 1,2) == '@' then
--remove leading "@"
capture_string = string.sub(capture_string, 2)
end
--remove leading "@"
capture_string = string.sub(capture_string, 2)
local best
local best_score