Wyatt Allen 437dc44709 Allow async recursion for syntax on zeroth diff section
The logic inside the syntax layer that decides whether the next step of
the processing is done synchronously or after a timeout would not choose
to use a timeout if it is processing the zeroth section of the diff.

For diffs with very large initial shared chunks (for example a chunk of
more than 20,000 lines as linked in the bug) this results in the syntax
layer processing the entire chunk using synchronous recursion.

As a result, the (1) UI would lock up while processing the syntax for
this chunk, and (2) when rendering all diffs on the change, the call
stack would be exceeded.

With this change, the syntax layer allows asynchrony when processing the
zeroth chunk of the diff.

Bug: Issue 5654
Change-Id: I0e60479b2c59c9c626199e7a6b8d63ccb55ebaa7
2017-02-28 13:13:22 -08:00
..