aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/file_io.lua18
-rw-r--r--core/init.lua2
-rw-r--r--core/lfs_ext.lua2
-rw-r--r--core/locale.lua2
-rw-r--r--core/ui.lua4
5 files changed, 14 insertions, 14 deletions
diff --git a/core/file_io.lua b/core/file_io.lua
index bced6219..ba84b65e 100644
--- a/core/file_io.lua
+++ b/core/file_io.lua
@@ -109,8 +109,8 @@ function io.open_file(filenames)
if not filenames then return end
for i = 1, #filenames do
local filename = lfs.abspath((filenames[i]:gsub('^file://', '')))
- for i, buffer in ipairs(_BUFFERS) do
- if filename == buffer.filename then view:goto_buffer(i) goto continue end
+ for j, buffer in ipairs(_BUFFERS) do
+ if filename == buffer.filename then view:goto_buffer(j) goto continue end
end
local text = ''
@@ -133,9 +133,9 @@ function io.open_file(filenames)
end
end
if not buffer.encoding and not text:sub(1, 65536):find('\0') then
- for i = 1, #io.encodings do
- local ok, conv = pcall(string.iconv, text, 'UTF-8', io.encodings[i])
- if ok then buffer.encoding, text = io.encodings[i], conv break end
+ for j = 1, #io.encodings do
+ local ok, conv = pcall(string.iconv, text, 'UTF-8', io.encodings[j])
+ if ok then buffer.encoding, text = io.encodings[j], conv break end
end
assert(buffer.encoding, _L['Encoding conversion failed.'])
end
@@ -152,8 +152,8 @@ function io.open_file(filenames)
events.emit(events.FILE_OPENED, filename)
-- Add file to recent files list, eliminating duplicates.
- for i, file in ipairs(io.recent_files) do
- if file == filename then table.remove(io.recent_files, i) break end
+ for j, file in ipairs(io.recent_files) do
+ if file == filename then table.remove(io.recent_files, j) break end
end
table.insert(io.recent_files, 1, filename)
::continue::
@@ -303,7 +303,7 @@ events_connect(events.RESUME, update_modified_file)
-- Prompts the user to reload the current file if it has been externally
-- modified.
-events_connect(events.FILE_CHANGED, function(filename)
+events_connect(events.FILE_CHANGED, function()
local msg = ('"%s"\n%s'):format(buffer.filename:iconv('UTF-8', _CHARSET),
_L['has been modified. Reload it?'])
local button = ui.dialogs.msgbox{
@@ -315,7 +315,7 @@ events_connect(events.FILE_CHANGED, function(filename)
end)
-- Closes the initial "Untitled" buffer.
-events_connect(events.FILE_OPENED, function(filename)
+events_connect(events.FILE_OPENED, function()
local buf = _BUFFERS[1]
if #_BUFFERS == 2 and not (buf.filename or buf._type or buf.modify) then
view:goto_buffer(1)
diff --git a/core/init.lua b/core/init.lua
index 2bfb0662..591c67d1 100644
--- a/core/init.lua
+++ b/core/init.lua
@@ -18,7 +18,7 @@ _M = {} -- language modules table
if jit then module, package.searchers, bit32 = nil, package.loaders, bit end
-- pdcurses compatibility.
if CURSES and WIN32 then
- function spawn(argv, cwd, stdout_cb, stderr_cb, exit_cb)
+ function spawn(argv, cwd, stdout_cb, _, exit_cb)
local current_dir = lfs.currentdir()
if cwd then lfs.chdir(cwd) end
local p = io.popen(argv..' 2>&1')
diff --git a/core/lfs_ext.lua b/core/lfs_ext.lua
index 8b96b861..b3dda4f7 100644
--- a/core/lfs_ext.lua
+++ b/core/lfs_ext.lua
@@ -41,7 +41,7 @@ local function exclude(file, filter)
end
---
--- Iterates over all files and sub-directories (up to level number *n*) in
+-- Iterates over all files and sub-directories (up to *n* levels deep) in
-- directory *dir*, calling function *f* with each file found.
-- Files passed to *f* do not match any pattern in string or table *filter*,
-- and, unless *exclude_FILTER* is `true`, `lfs.FILTER` as well. A filter table
diff --git a/core/locale.lua b/core/locale.lua
index def44789..1dedd4a3 100644
--- a/core/locale.lua
+++ b/core/locale.lua
@@ -25,4 +25,4 @@ end
f:close()
return setmetatable(M,
- {__index = function(t, k) return 'No Localization:'..k end})
+ {__index = function(_, k) return 'No Localization:'..k end})
diff --git a/core/ui.lua b/core/ui.lua
index c6244ea2..1da1b159 100644
--- a/core/ui.lua
+++ b/core/ui.lua
@@ -43,7 +43,7 @@ local theme_props = {}
-- @see ui._print
local function _print(buffer_type, ...)
local print_buffer
- for i, buffer in ipairs(_BUFFERS) do
+ for _, buffer in ipairs(_BUFFERS) do
if buffer._type == buffer_type then print_buffer = buffer break end
end
if not print_buffer then
@@ -85,7 +85,7 @@ function ui._print(buffer_type, ...) pcall(_print, buffer_type, ...) end
function ui.print(...) ui._print(_L['[Message Buffer]'], ...) end
-- Documentation is in core/.ui.dialogs.luadoc.
-ui.dialogs = setmetatable({}, {__index = function(t, k)
+ui.dialogs = setmetatable({}, {__index = function(_, k)
-- Wrapper for `ui.dialog(k)`, transforming the given table of arguments into
-- a set of command line arguments and transforming the resulting standard
-- output into Lua objects.