Don't use threads in `detectindent`

As it's execution only happens on load/save.
This commit is contained in:
Guldoman 2021-09-06 22:58:43 +02:00 committed by Francesco
parent 501be5fdfe
commit 0d2a89cb76
1 changed files with 3 additions and 12 deletions

View File

@ -116,23 +116,14 @@ local new = Doc.new
function Doc:new(...) function Doc:new(...)
new(self, ...) new(self, ...)
update_cache(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 end
local clean = Doc.clean local clean = Doc.clean
function Doc:clean(...) function Doc:clean(...)
clean(self, ...) clean(self, ...)
cache[self].need_update = true if not cache[self].confirmed then
update_cache(self)
end
end end