diff options
author | 2020-03-16 11:00:11 -0400 | |
---|---|---|
committer | 2020-03-16 11:00:11 -0400 | |
commit | 23a9f5b45e2eedf8366e0b0b45450190b66dd3f2 (patch) | |
tree | d1f4cabae1e4865058f8b78e465605fa442431b4 /modules/lua/init.lua | |
parent | 88e963846ad48e60a6b245fc207ffa60d0cac84f (diff) | |
download | textadept-23a9f5b45e2eedf8366e0b0b45450190b66dd3f2.tar.gz textadept-23a9f5b45e2eedf8366e0b0b45450190b66dd3f2.zip |
Small code cleanup.
Diffstat (limited to 'modules/lua/init.lua')
-rw-r--r-- | modules/lua/init.lua | 8 |
1 files changed, 4 insertions, 4 deletions
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(.*)$') |