mirror of
https://github.com/textmate/textmate.git
synced 2026-04-28 03:00:34 -04:00
Inform callbacks about updated scopes when interrupting “batch parsing”
We delay updating callbacks until we have parsed 10 lines to avoid line-by-line redraw of the screen, but incase the buffer got mutated during this batch parsing, we would previously restart the parser and forget about the ranges already parsed (that no-one had been told about).
This commit is contained in:
@@ -58,8 +58,16 @@ namespace ng
|
||||
if(bufferRef.lock())
|
||||
{
|
||||
if(bufferRev == revision())
|
||||
update_scopes(limit_redraw, batch_start, { from, to }, result.scopes, result.state);
|
||||
else initiate_repair();
|
||||
{
|
||||
update_scopes(limit_redraw, batch_start, { from, to }, result.scopes, result.state);
|
||||
}
|
||||
else
|
||||
{
|
||||
// We didn’t inform anyone about the previous lines parsed
|
||||
if(batch_start != from)
|
||||
did_parse(std::min(batch_start, size()), std::min(from, size()));
|
||||
initiate_repair();
|
||||
}
|
||||
}
|
||||
});
|
||||
CFRunLoopWakeUp(runLoop);
|
||||
|
||||
Reference in New Issue
Block a user