Merge pull request #821 from dheisom-gomes/improvements
Improvements on core.add_thread function
This commit is contained in:
commit
e5f17aea4b
|
@ -445,4 +445,5 @@ function common.rm(path, recursively)
|
|||
return true
|
||||
end
|
||||
|
||||
|
||||
return common
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue