diff options
| -rw-r--r-- | lua/plugins/complete-filename.lua | 2 | ||||
| -rw-r--r-- | lua/plugins/filetype.lua | 7 | ||||
| -rw-r--r-- | lua/vis.lua | 2 |
3 files changed, 6 insertions, 5 deletions
diff --git a/lua/plugins/complete-filename.lua b/lua/plugins/complete-filename.lua index 03cc313..e955347 100644 --- a/lua/plugins/complete-filename.lua +++ b/lua/plugins/complete-filename.lua @@ -13,7 +13,7 @@ vis:map(vis.modes.INSERT, "<C-x><C-f>", function() local prefix = file:content(range) if not prefix then return end -- Strip leading delimiters for some languages - i, j = string.find(prefix, "[[(<'\"]+") + local _, j = string.find(prefix, "[[(<'\"]+") if j then prefix = prefix:sub(j + 1) end local cmd = string.format("vis-complete --file '%s'", prefix:gsub("'", "'\\''")) local status, out, err = vis:pipe(file, { start = 0, finish = 0 }, cmd) diff --git a/lua/plugins/filetype.lua b/lua/plugins/filetype.lua index 4639bbc..e5e45fd 100644 --- a/lua/plugins/filetype.lua +++ b/lua/plugins/filetype.lua @@ -352,7 +352,7 @@ vis.ftdetect.filetypes = { }, routeros = { ext = { "%.rsc" }, - detect = function(file, data) + detect = function(_, data) return data:match("^#.* by RouterOS") end }, @@ -394,7 +394,7 @@ vis.ftdetect.filetypes = { ext = { "%.ddl$", "%.sql$" }, }, strace = { - detect = function(file, data) + detect = function(_, data) return data:match("^execve%(") end }, @@ -501,10 +501,11 @@ vis.events.subscribe(vis.events.WIN_OPEN, function(win) end -- run file(1) to determine mime type + local mime if name ~= nil then local file = io.popen(string.format("file -bL --mime-type -- '%s'", name:gsub("'", "'\\''"))) if file then - local mime = file:read('*all') + mime = file:read('*all') file:close() if mime then mime = mime:gsub('%s*$', '') diff --git a/lua/vis.lua b/lua/vis.lua index dd17192..699d2e2 100644 --- a/lua/vis.lua +++ b/lua/vis.lua @@ -103,7 +103,7 @@ end -- Checks whether a subsequent @{require} call will succeed. -- @tparam string name the module name to check -- @treturn bool whether the module was found -vis.module_exist = function(vis, name) +vis.module_exist = function(_, name) for _, searcher in ipairs(package.searchers or package.loaders) do local loader = searcher(name) if type(loader) == 'function' then |
