From 0d2a89cb76fa975a76737a5f4439d65101fc2185 Mon Sep 17 00:00:00 2001 From: Guldoman Date: Mon, 6 Sep 2021 22:58:43 +0200 Subject: [PATCH] Don't use threads in `detectindent` As it's execution only happens on load/save. --- data/plugins/detectindent.lua | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/data/plugins/detectindent.lua b/data/plugins/detectindent.lua index d75f05f2..7ddbaf6c 100644 --- a/data/plugins/detectindent.lua +++ b/data/plugins/detectindent.lua @@ -116,23 +116,14 @@ local new = Doc.new function Doc:new(...) new(self, ...) update_cache(self) - if not cache[self].confirmed then - core.add_thread(function () - while not cache[self].confirmed do - if cache[self].need_update then - update_cache(self) - cache[self].need_update = false - end - coroutine.yield() - end - end, self) - end end local clean = Doc.clean function Doc:clean(...) clean(self, ...) - cache[self].need_update = true + if not cache[self].confirmed then + update_cache(self) + end end