aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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