aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authormitchell <70453897+orbitalquark@users.noreply.github.com>2021-04-14 14:53:19 -0400
committermitchell <70453897+orbitalquark@users.noreply.github.com>2021-04-14 14:53:19 -0400
commit8ff320ad70a5183acc2bd635dfef33a792bd7f5a (patch)
treeb44b3debb1f52857aaafab7f499a978c2686e170 /modules
parent61f0475bbacbe0d1c1492c5be6510fc144d3926f (diff)
downloadtextadept-8ff320ad70a5183acc2bd635dfef33a792bd7f5a.tar.gz
textadept-8ff320ad70a5183acc2bd635dfef33a792bd7f5a.zip
Addressed some minor Luacheck issues.
Not all shadowing warnings need to be fixed.
Diffstat (limited to 'modules')
-rw-r--r--modules/textadept/command_entry.lua6
-rw-r--r--modules/textadept/editing.lua2
-rw-r--r--modules/textadept/menu.lua4
-rw-r--r--modules/textadept/snippets.lua4
4 files changed, 8 insertions, 8 deletions
diff --git a/modules/textadept/command_entry.lua b/modules/textadept/command_entry.lua
index cecad02c..c1dddc5e 100644
--- a/modules/textadept/command_entry.lua
+++ b/modules/textadept/command_entry.lua
@@ -163,10 +163,10 @@ local function complete_lua()
local global_envs = not ok and
{buffer, view, ui, _G, textadept, sci.functions, sci.properties, sci.constants} or op == ':' and
{sci.functions} or {sci.properties, sci.constants}
- for _, env in ipairs(global_envs) do
- for k, v in pairs(env) do
+ for _, t in ipairs(global_envs) do
+ for k, v in pairs(t) do
if type(k) ~= 'string' or not k:find(part) then goto continue end
- local xpm = (type(v) == 'function' or env == sci.functions) and XPM.METHOD or XPM.VARIABLE
+ local xpm = (type(v) == 'function' or t == sci.functions) and XPM.METHOD or XPM.VARIABLE
cmpls[#cmpls + 1] = k .. sep .. xpm
::continue::
end
diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua
index 1b4a51ba..ae98720e 100644
--- a/modules/textadept/editing.lua
+++ b/modules/textadept/editing.lua
@@ -335,7 +335,7 @@ function M.paste_reindent()
buffer:replace_sel(text)
buffer.line_indentation[line] = start_indent
if text:find('\n') then
- local line = buffer:line_from_position(buffer.current_pos)
+ line = buffer:line_from_position(buffer.current_pos)
buffer.line_indentation[line] = end_indent
buffer:goto_pos(buffer:find_column(line, end_column))
end
diff --git a/modules/textadept/menu.lua b/modules/textadept/menu.lua
index 54195bd9..ddfb81cb 100644
--- a/modules/textadept/menu.lua
+++ b/modules/textadept/menu.lua
@@ -390,8 +390,8 @@ local function read_menu_table(menu, contextmenu)
local key, mods = get_gdk_key(key_shortcuts[tostring(item[2])])
gtkmenu[#gtkmenu + 1] = {item[1], menu_id, key, mods}
if item[2] then
- local menu_items = not contextmenu and menu_items or contextmenu_items
- menu_items[menu_id < 1000 and menu_id or menu_id - 1000] = item
+ local items = not contextmenu and menu_items or contextmenu_items
+ items[menu_id < 1000 and menu_id or menu_id - 1000] = item
end
end
end
diff --git a/modules/textadept/snippets.lua b/modules/textadept/snippets.lua
index e900f2b4..a7241a12 100644
--- a/modules/textadept/snippets.lua
+++ b/modules/textadept/snippets.lua
@@ -168,7 +168,7 @@ local function find_snippet(grep, no_trigger)
(grep and
(p1 == lang and p2 and p2:find(name_patt) or p1 and p1:find(name_patt) and p3 == '')) then
local f = io.open(string.format('%s/%s', M.paths[i], basename))
- text = f:read('a')
+ local text = f:read('a')
f:close()
if not grep then return trigger, text end
matching_snippets[p1 == lang and p2 or p1] = text
@@ -424,7 +424,7 @@ function snippet:next()
local text = ph.default or ''
::redo::
for pos in self:each_placeholder(self.index, 'simple') do
- local e = buffer:indicator_end(M.INDIC_PLACEHOLDER, pos)
+ e = buffer:indicator_end(M.INDIC_PLACEHOLDER, pos)
buffer:indicator_clear_range(pos, e - pos)
buffer:set_target_range(pos, pos + 1)
buffer:replace_target(text)