Skip to content

Commit

Permalink
Use proper timeouts for coroutines that don't need to wait (lite-xl#1467
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Guldoman authored Aug 4, 2023
1 parent bfc4892 commit e468545
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion data/core/doc/highlighter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion data/plugins/projectsearch.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e468545

Please sign in to comment.