replace unpack() with table.unpack()

I have no idea unpack() is still used and how it still worked.
This commit is contained in:
takase1121
2021-08-29 09:14:12 +08:00
parent ccba91261d
commit 30ccde896d
3 changed files with 12 additions and 12 deletions
+6 -6
View File
@@ -36,7 +36,7 @@ local function update_preview(sel, search_fn, text)
last_view:scroll_to_line(line2, true)
return true
else
last_view.doc:set_selection(unpack(sel))
last_view.doc:set_selection(table.unpack(sel))
return false
end
end
@@ -44,7 +44,7 @@ end
local function find(label, search_fn)
last_view, last_sel, last_finds = core.active_view,
{ core.active_view.doc:get_selection() }, {}
local text, found = last_view.doc:get_text(unpack(last_sel)), false
local text, found = last_view.doc:get_text(table.unpack(last_sel)), false
core.command_view:set_text(text, true)
core.status_view:show_tooltip(get_find_tooltip())
@@ -55,8 +55,8 @@ local function find(label, search_fn)
last_fn, last_text = search_fn, text
else
core.error("Couldn't find %q", text)
last_view.doc:set_selection(unpack(last_sel))
last_view:scroll_to_make_visible(unpack(last_sel))
last_view.doc:set_selection(table.unpack(last_sel))
last_view:scroll_to_make_visible(table.unpack(last_sel))
end
end, function(text)
found = update_preview(last_sel, search_fn, text)
@@ -64,8 +64,8 @@ local function find(label, search_fn)
end, function(explicit)
core.status_view:remove_tooltip()
if explicit then
last_view.doc:set_selection(unpack(last_sel))
last_view:scroll_to_make_visible(unpack(last_sel))
last_view.doc:set_selection(table.unpack(last_sel))
last_view:scroll_to_make_visible(table.unpack(last_sel))
end
end)
end