mirror of
https://github.com/mawww/kakoune.git
synced 2024-12-25 04:24:48 +03:00
Fix LineRangeSet::udpate not updating some traling ranges correctly
Fixes #2499
This commit is contained in:
parent
da13b5f814
commit
a383ce3045
@ -1802,7 +1802,7 @@ struct LineRangeSet : private Vector<LineRange, MemoryDomain::Highlight>
|
|||||||
const auto diff = (modif_beg-1)->diff();
|
const auto diff = (modif_beg-1)->diff();
|
||||||
it->begin += diff;
|
it->begin += diff;
|
||||||
it->end += diff;
|
it->end += diff;
|
||||||
break;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto diff = modif_beg->new_line - modif_beg->old_line;
|
const auto diff = modif_beg->new_line - modif_beg->old_line;
|
||||||
@ -2445,8 +2445,9 @@ UnitTest test_line_range_set{[]{
|
|||||||
ranges.add_range({0, 1}, expect({{0, 1}}));
|
ranges.add_range({0, 1}, expect({{0, 1}}));
|
||||||
ranges.add_range({5, 10}, expect({{5, 10}}));
|
ranges.add_range({5, 10}, expect({{5, 10}}));
|
||||||
ranges.add_range({15, 20}, expect({{15, 20}}));
|
ranges.add_range({15, 20}, expect({{15, 20}}));
|
||||||
|
ranges.add_range({25, 30}, expect({{25, 30}}));
|
||||||
ranges.update(ConstArrayView<LineModification>{{2, 2, 3, 0}});
|
ranges.update(ConstArrayView<LineModification>{{2, 2, 3, 0}});
|
||||||
kak_assert((ranges.view() == ConstArrayView<LineRange>{{0, 1}, {2, 7}, {12, 17}}));
|
kak_assert((ranges.view() == ConstArrayView<LineRange>{{0, 1}, {2, 7}, {12, 17}, {22, 27}}));
|
||||||
}
|
}
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
1
test/regression/2499-html-regions-assert/cmd
Normal file
1
test/regression/2499-html-regions-assert/cmd
Normal file
@ -0,0 +1 @@
|
|||||||
|
jjjJJ<a-x><c-l>d<c-l>
|
16
test/regression/2499-html-regions-assert/in
Normal file
16
test/regression/2499-html-regions-assert/in
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<html>
|
||||||
|
<head></head>
|
||||||
|
<body>
|
||||||
|
<div>
|
||||||
|
<input name="bar"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="foo" class="bar">
|
||||||
|
Test 1
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="baz" class="fiz">
|
||||||
|
Test 2
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
3
test/regression/2499-html-regions-assert/rc
Normal file
3
test/regression/2499-html-regions-assert/rc
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
source "%val{runtime}/colors/default.kak"
|
||||||
|
source "%val{runtime}/rc/base/html.kak"
|
||||||
|
set buffer filetype html
|
Loading…
Reference in New Issue
Block a user