diff --git a/data/core/common.lua b/data/core/common.lua index 37d30436..6a25cae2 100644 --- a/data/core/common.lua +++ b/data/core/common.lua @@ -22,7 +22,7 @@ function common.merge(a, b) for k, v in pairs(a) do t[k] = v end if b then for k, v in pairs(b) do t[k] = v end end return t -end +end function common.round(n) @@ -445,4 +445,5 @@ function common.rm(path, recursively) return true end + return common diff --git a/data/core/config.lua b/data/core/config.lua index 1233595b..d8a0bbd1 100644 --- a/data/core/config.lua +++ b/data/core/config.lua @@ -6,7 +6,7 @@ config.message_timeout = 5 config.mouse_wheel_scroll = 50 * SCALE config.scroll_past_end = true config.file_size_limit = 10 -config.ignore_files = "^%." +config.ignore_files = { "^%." } config.symbol_pattern = "[%a_][%w_]*" config.non_word_chars = " \t\n/\\()\"':,.;<>~!@#$%^&*|+=[]{}`?-" config.undo_merge_timeout = 0.3 @@ -32,11 +32,11 @@ config.max_clicks = 3 config.plugins = {} -- Allow you to set plugin configs even if we haven't seen the plugin before. -setmetatable(config.plugins, { - __index = function(t, k) - if rawget(t, k) == nil then rawset(t, k, {}) end - return rawget(t, k) - end +setmetatable(config.plugins, { + __index = function(t, k) + if rawget(t, k) == nil then rawset(t, k, {}) end + return rawget(t, k) + end }) -- Disable these plugins by default. diff --git a/data/core/init.lua b/data/core/init.lua index 743d6ca1..49a7370c 100644 --- a/data/core/init.lua +++ b/data/core/init.lua @@ -1218,9 +1218,10 @@ function core.show_title_bar(show) end -function core.add_thread(f, weak_ref) +function core.add_thread(f, weak_ref, ...) local key = weak_ref or #core.threads + 1 - local fn = function() return core.try(f) end + local args = {...} + local fn = function() return core.try(f, table.unpack(args)) end core.threads[key] = { cr = coroutine.create(fn), wake = 0 } return key end