aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/ansi_c/init.lua6
-rw-r--r--modules/lua/init.lua8
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(.*)$')