Don't use threads in `detectindent`
As it's execution only happens on load/save.
This commit is contained in:
parent
501be5fdfe
commit
0d2a89cb76
|
@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue