aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/file_io.lua3
-rw-r--r--core/ui.lua4
-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
6 files changed, 12 insertions, 11 deletions
diff --git a/core/file_io.lua b/core/file_io.lua
index 6760c4cd..627403e1 100644
--- a/core/file_io.lua
+++ b/core/file_io.lua
@@ -319,7 +319,8 @@ function io.open_recent_file()
table.remove(io.recent_files, i)
end
end
- local button, i = ui.dialogs.filteredlist{
+ local button
+ button, i = ui.dialogs.filteredlist{
title = _L['Open File'], columns = _L['Filename'], items = utf8_list
}
if button == 1 and i then io.open_file(io.recent_files[i]) end
diff --git a/core/ui.lua b/core/ui.lua
index eb366c93..2e0635fa 100644
--- a/core/ui.lua
+++ b/core/ui.lua
@@ -274,8 +274,8 @@ function ui.goto_file(filename, split, preferred_view, sloppy)
else
local other_view = _VIEWS[preferred_view]
for _, view in ipairs(_VIEWS) do
- local filename = view.buffer.filename or ''
- if filename:find(patt) then
+ local view_filename = view.buffer.filename or ''
+ if view_filename:find(patt) then
ui.goto_view(view)
return
end
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)