From 23a9f5b45e2eedf8366e0b0b45450190b66dd3f2 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Mon, 16 Mar 2020 11:00:11 -0400 Subject: Small code cleanup. --- modules/ansi_c/init.lua | 6 +++--- modules/lua/init.lua | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/ansi_c/init.lua b/modules/ansi_c/init.lua index 72cd88b2..c4296023 100644 --- a/modules/ansi_c/init.lua +++ b/modules/ansi_c/init.lua @@ -55,9 +55,9 @@ textadept.editing.autocompleters.ansi_c = function() local sep = string.char(buffer.auto_c_type_separator) ::rescan:: local list = {} - for i = 1, #tags_files do - if not lfs.attributes(tags_files[i]) then goto continue end - for tag_line in io.lines(tags_files[i]) do + for _, filename in ipairs(tags_files) do + if not lfs.attributes(filename) then goto continue end + for tag_line in io.lines(filename) do local name = tag_line:match('^%S+') if (name:find(name_patt) and not name:find('^!') and not list[name]) or name == symbol and op == '' then diff --git a/modules/lua/init.lua b/modules/lua/init.lua index 113e065c..a82d9884 100644 --- a/modules/lua/init.lua +++ b/modules/lua/init.lua @@ -81,10 +81,10 @@ textadept.editing.autocompleters.lua = function() -- Search through ctags for completions for that symbol. local name_patt = '^' .. part local sep = string.char(buffer.auto_c_type_separator) - for _, file in ipairs(M.tags) do - if type(file) == 'function' then file = file() end - if not file or not lfs.attributes(file) then goto continue end - for tag_line in io.lines(file) do + for _, filename in ipairs(M.tags) do + if type(filename) == 'function' then filename = filename() end + if not filename or not lfs.attributes(filename) then goto continue end + for tag_line in io.lines(filename) do local name = tag_line:match('^%S+') if name:find(name_patt) and not list[name] then local fields = tag_line:match(';"\t(.*)$') -- cgit v1.2.3