diff options
author | ZyX <kp-pav@yandex.ru> | 2017-01-28 01:07:18 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2017-03-27 00:12:23 +0300 |
commit | 52c7066f4b546419a1838b41e68a5d1650ac498e (patch) | |
tree | 47dab09dc2b4133db09ee2f1610d2195ac5f1363 | |
parent | c470fc32a8c96fb153b779489c22b8e86003e9f0 (diff) | |
download | rneovim-52c7066f4b546419a1838b41e68a5d1650ac498e.tar.gz rneovim-52c7066f4b546419a1838b41e68a5d1650ac498e.tar.bz2 rneovim-52c7066f4b546419a1838b41e68a5d1650ac498e.zip |
gendeclarations: Handle case when text did not match
-rwxr-xr-x | scripts/gendeclarations.lua | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/scripts/gendeclarations.lua b/scripts/gendeclarations.lua index 5d5939f7d1..3f948b91df 100755 --- a/scripts/gendeclarations.lua +++ b/scripts/gendeclarations.lua @@ -208,13 +208,15 @@ while init ~= nil do local line, dir, file = text:match(filepattern, init) if file ~= nil then curfile = file - end - declline = tonumber(line) - 1 - local curdir_start = dir:find('src/nvim/') - if curdir_start ~= nil then - curdir = dir:sub(curdir_start + #('src/nvim/')) + declline = tonumber(line) - 1 + local curdir_start = dir:find('src/nvim/') + if curdir_start ~= nil then + curdir = dir:sub(curdir_start + #('src/nvim/')) + else + curdir = dir + end else - curdir = dir + declline = declline - 1 end elseif init < declendpos then -- Skipping over declaration |