Fix crash on non utf8 files trigering highlighting of backward ranges
Fixes #1274
This commit is contained in:
parent
a0b42323ed
commit
0faa5567ca
|
@ -30,7 +30,8 @@ void highlight_range(DisplayBuffer& display_buffer,
|
||||||
BufferCoord begin, BufferCoord end,
|
BufferCoord begin, BufferCoord end,
|
||||||
bool skip_replaced, T func)
|
bool skip_replaced, T func)
|
||||||
{
|
{
|
||||||
if (begin == end or end <= display_buffer.range().begin
|
// tolerate begin > end as that can be triggered by wrong encodngs
|
||||||
|
if (begin >= end or end <= display_buffer.range().begin
|
||||||
or begin >= display_buffer.range().end)
|
or begin >= display_buffer.range().end)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user