Fix performance issue in show-matching highlighter on big buffers
Stop searching for the matching character when getting out of view instead of going until the buffer edge.
This commit is contained in:
parent
0fd5a9d995
commit
04a64e6e29
|
@ -1203,7 +1203,7 @@ void show_matching_char(HighlightContext context, DisplayBuffer& display_buffer,
|
|||
{
|
||||
const Codepoint opening = *match;
|
||||
const Codepoint closing = *(match+1);
|
||||
while (it != buffer.end())
|
||||
while (it.base().coord() <= range.end)
|
||||
{
|
||||
if (*it == opening)
|
||||
++level;
|
||||
|
@ -1230,7 +1230,7 @@ void show_matching_char(HighlightContext context, DisplayBuffer& display_buffer,
|
|||
false, apply_face(face));
|
||||
break;
|
||||
}
|
||||
if (it == buffer.begin())
|
||||
if (it.base().coord() <= range.begin)
|
||||
break;
|
||||
--it;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user