Use proper timeouts for coroutines that don't need to wait (#1467)

This commit is contained in:
Guldoman 2023-08-04 15:40:02 +02:00 committed by George Sokianos
parent a80414fb0b
commit 4454fcc3a2
2 changed files with 2 additions and 2 deletions

View File

@ -48,7 +48,7 @@ function Highlighter:start()
self:update_notify(retokenized_from, max - retokenized_from)
end
core.redraw = true
coroutine.yield()
coroutine.yield(0)
end
self.max_wanted_line = 0
self.running = false

View File

@ -37,7 +37,7 @@ local function find_all_matches_in_file(t, filename, fn)
table.insert(t, { file = filename, text = (start_index > 1 and "..." or "") .. line:sub(start_index, 256 + start_index), line = n, col = s })
core.redraw = true
end
if n % 100 == 0 then coroutine.yield() end
if n % 100 == 0 then coroutine.yield(0) end
n = n + 1
core.redraw = true
end