Commit: 0baeb30f9259673628657ee0b3a10aedf5a46bcb
Parent: 236e51d5221a8f5c887544ccc325fb4a3fb57362
Author: Ren Tatsumoto
Date: Tue, 6 Apr 2021 12:49:40 +0300
tweak main
Diffstat:
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/subs2srs.lua b/subs2srs.lua
@@ -1529,11 +1529,14 @@ end
------------------------------------------------------------
-- main
-local main
-do
+local main = (function()
local main_executed = false
- main = function()
- if main_executed then return end
+ return function()
+ if main_executed then
+ return
+ else
+ main_executed = true
+ end
validate_config()
clip_autocopy.init()
if config.create_deck == true then
@@ -1561,7 +1564,7 @@ do
mp.add_key_binding(nil, "mpvacious-toggle-sub-autocopy", clip_autocopy.toggle)
mp.add_key_binding(nil, "mpvacious-update-last-note", update_last_note)
- main_executed = true
end
-end
+end)()
+
mp.register_event("file-loaded", main)