mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-08-28 19:11:03 +08:00
fix(ui): release interrupted markdown highlight jobs
This commit is contained in:
@@ -57,5 +57,6 @@ describe("Markdown rAF-coalesced parse — regression guard", () => {
|
||||
expect(src).toContain("preserveStreamingHighlight(fromEl, toEl, local.streaming ?? false)")
|
||||
expect(body).toContain("export function preserveStreamingHighlight")
|
||||
expect(body).toMatch(/continues\(before, after\)[\s\S]*queue\(from, after, lang\)/)
|
||||
expect(body).toMatch(/const done = \(\) => \{\s*job\.busy = false\s*if \(!pre\.isConnected\) return/)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -61,13 +61,12 @@ function run(pre: HTMLPreElement, job: Job) {
|
||||
const lang = job.lang
|
||||
job.busy = true
|
||||
const done = () => {
|
||||
job.busy = false
|
||||
if (!pre.isConnected) return
|
||||
if (job.code !== code || job.lang !== lang) {
|
||||
job.busy = false
|
||||
run(pre, job)
|
||||
return
|
||||
}
|
||||
job.busy = false
|
||||
}
|
||||
void refresh(pre, code, lang).then(done, done)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user