Fix compute_modified_ranges corner case that would crash on undo
Fixes #1506 Fixes #1215
This commit is contained in:
parent
40352aed9d
commit
d142db80f2
|
@ -167,6 +167,8 @@ Vector<Selection> compute_modified_ranges(Buffer& buffer, size_t timestamp)
|
|||
|
||||
kak_assert(std::is_sorted(ranges.begin() + prev_size, ranges.end(), compare_selections));
|
||||
std::inplace_merge(ranges.begin(), ranges.begin() + prev_size, ranges.end(), compare_selections);
|
||||
// The newly added ranges might be overlapping pre-existing ones
|
||||
ranges.erase(merge_overlapping(ranges.begin(), ranges.end(), dummy, overlaps), ranges.end());
|
||||
}
|
||||
|
||||
const auto end_coord = buffer.end_coord();
|
||||
|
|
Loading…
Reference in New Issue
Block a user