parent
aad20f6576
commit
109abbeed4
|
@ -2131,16 +2131,16 @@ private:
|
||||||
auto end_it = matches.find_matching_end(buffer, beg_it->end_coord(),
|
auto end_it = matches.find_matching_end(buffer, beg_it->end_coord(),
|
||||||
region.value->match_capture() ? beg_it->capture(buffer) : Optional<StringView>{});
|
region.value->match_capture() ? beg_it->capture(buffer) : Optional<StringView>{});
|
||||||
|
|
||||||
if (end_it == matches.end_matches.end() or end_it->end_coord() >= range.end)
|
if (end_it == matches.end_matches.end() or end_it->end_coord() >= range.end) // region continue past range end
|
||||||
{
|
{
|
||||||
regions.push_back({ {beg_it->line, beg_it->begin},
|
auto begin_coord = beg_it->begin_coord();
|
||||||
range.end,
|
if (begin_coord < range.end)
|
||||||
region.key });
|
regions.push_back({begin_coord, range.end, region.key});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto end_coord = end_it->end_coord();
|
auto end_coord = end_it->end_coord();
|
||||||
regions.push_back({ beg_it->begin_coord(), end_coord, region.key });
|
regions.push_back({beg_it->begin_coord(), end_coord, region.key});
|
||||||
|
|
||||||
// With empty begin and end matches (for example if the regexes
|
// With empty begin and end matches (for example if the regexes
|
||||||
// are /"\K/ and /(?=")/), that case can happen, and would
|
// are /"\K/ and /(?=")/), that case can happen, and would
|
||||||
|
|
1
test/regression/3495-crash-highlighting-hidden-lines/in
Normal file
1
test/regression/3495-crash-highlighting-hidden-lines/in
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{}{<>}
|
9
test/regression/3495-crash-highlighting-hidden-lines/rc
Normal file
9
test/regression/3495-crash-highlighting-hidden-lines/rc
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
add-highlighter global/rs regions
|
||||||
|
add-highlighter global/rs/r1 region \{ \} ref sub
|
||||||
|
|
||||||
|
add-highlighter shared/sub regions
|
||||||
|
add-highlighter shared/sub/r2 region < > group
|
||||||
|
add-highlighter shared/sub/r2/ regex X 0:red
|
||||||
|
|
||||||
|
declare-option range-specs replaced_part 1 1.2,1.4|Placeholder
|
||||||
|
add-highlighter global/ replace-ranges replaced_part
|
Loading…
Reference in New Issue
Block a user