gendeclarations: Handle case when text did not match

This commit is contained in:
ZyX 2017-01-28 01:07:18 +03:00
parent c470fc32a8
commit 52c7066f4b

View File

@ -208,13 +208,15 @@ while init ~= nil do
local line, dir, file = text:match(filepattern, init) local line, dir, file = text:match(filepattern, init)
if file ~= nil then if file ~= nil then
curfile = file curfile = file
end declline = tonumber(line) - 1
declline = tonumber(line) - 1 local curdir_start = dir:find('src/nvim/')
local curdir_start = dir:find('src/nvim/') if curdir_start ~= nil then
if curdir_start ~= nil then curdir = dir:sub(curdir_start + #('src/nvim/'))
curdir = dir:sub(curdir_start + #('src/nvim/')) else
curdir = dir
end
else else
curdir = dir declline = declline - 1
end end
elseif init < declendpos then elseif init < declendpos then
-- Skipping over declaration -- Skipping over declaration