Since @christian-brabandt said for someone else to post the answer, I'll try to consolidate things and close out the question.
Check the help for :h synmaxcol
(@christian-brabandt) -
'synmaxcol' 'smc'
'synmaxcol' 'smc' number (default 3000)
local to buffer
{not available when compiled without the +syntax
feature}
Maximum column in which to search for syntax items. In long lines the
text after this column is not highlighted and following lines may not
be highlighted correctly, because the syntax state is cleared.
This helps to avoid very slow redrawing for an XML file that is one
long line.
Set to zero to remove the limit.
From @b-layer:
Ah, yes, good one. Presumably that's the mechanism causing it to "give up" now (default value: column 3000). So the choice may come down to lower synmaxcol
so you retain the current, partial highlighting but without performance problems or say, "heck with it", and shut highlighting off. Still, I'd try temporarily commenting the line out in the hope that you'd fix performance but have highlighting in the rest of the file (except the long line).
And lastly, your own answer of :set synmaxcol=45
fixed your issue.
:syntax off
help? If so, a possible workaround that's slightly less drastic may be temporarily wrapping the long line in HTML comment though that's not guaranteed to work. May just need to keep all highlighting off for this file if you can live with that.:h synmaxcol
synmaxcol
so you retain the current, partial highlighting but without performance problems or say, "heck with it", and shut highlighting off. Still, I'd try temporarily commenting the line out in the hope that you'd fix performance but have highlighting in the rest of the file (except the long line).synmaxcol
may be the optimal choice as the help says the lines following the long line "MAY not be highlighted correctly".