diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2018-03-08 20:26:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-08 20:26:18 +0100 |
commit | 9cefd83cc7b96d9a20ae8aae5ad5f2c4a02a74f4 (patch) | |
tree | 2933dd4aa96bd42eb8939c7a2afe2fcf544834f1 /src/nvim/generators/gen_declarations.lua | |
parent | d82621877b72ee8322a5b88adaba4edd5ad3b308 (diff) | |
parent | 0adf950ccf9a0057c552a349d79a716ff7be6f8f (diff) | |
download | rneovim-9cefd83cc7b96d9a20ae8aae5ad5f2c4a02a74f4.tar.gz rneovim-9cefd83cc7b96d9a20ae8aae5ad5f2c4a02a74f4.tar.bz2 rneovim-9cefd83cc7b96d9a20ae8aae5ad5f2c4a02a74f4.zip |
Merge #8084 'build/win: support MSVC'
Diffstat (limited to 'src/nvim/generators/gen_declarations.lua')
-rwxr-xr-x | src/nvim/generators/gen_declarations.lua | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/nvim/generators/gen_declarations.lua b/src/nvim/generators/gen_declarations.lua index 065c043557..c40c37bb3e 100755 --- a/src/nvim/generators/gen_declarations.lua +++ b/src/nvim/generators/gen_declarations.lua @@ -224,23 +224,15 @@ local static = header local filepattern = '^#%a* (%d+) "([^"]-)/?([^"/]+)"' local curfile -local init = 0 +local init = 1 local curfile = nil local neededfile = fname:match('[^/]+$') local declline = 0 local declendpos = 0 local curdir = nil local is_needed_file = false +local init_is_nl = true while init ~= nil do - init = text:find('[\n;}]', init) - if init == nil then - break - end - local init_is_nl = text:sub(init, init) == '\n' - init = init + 1 - if init_is_nl and is_needed_file then - declline = declline + 1 - end if init_is_nl and text:sub(init, init) == '#' then local line, dir, file = text:match(filepattern, init) if file ~= nil then @@ -293,6 +285,15 @@ while init ~= nil do declendpos = e end end + init = text:find('[\n;}]', init) + if init == nil then + break + end + init_is_nl = text:sub(init, init) == '\n' + init = init + 1 + if init_is_nl and is_needed_file then + declline = declline + 1 + end end non_static = non_static .. footer |