aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2017-01-28 01:07:18 +0300
committerZyX <kp-pav@yandex.ru>2017-03-27 00:12:23 +0300
commit52c7066f4b546419a1838b41e68a5d1650ac498e (patch)
tree47dab09dc2b4133db09ee2f1610d2195ac5f1363
parentc470fc32a8c96fb153b779489c22b8e86003e9f0 (diff)
downloadrneovim-52c7066f4b546419a1838b41e68a5d1650ac498e.tar.gz
rneovim-52c7066f4b546419a1838b41e68a5d1650ac498e.tar.bz2
rneovim-52c7066f4b546419a1838b41e68a5d1650ac498e.zip
gendeclarations: Handle case when text did not match
-rwxr-xr-xscripts/gendeclarations.lua14
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