1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-11-23 23:34:12 +03:00

Avoid buffer end in compute_modified_ranges

This commit is contained in:
Maxime Coste 2015-06-05 13:10:30 +01:00
parent 7cddaacc5d
commit 87fcfda508

View File

@ -321,6 +321,11 @@ Vector<Selection> compute_modified_ranges(Buffer& buffer, size_t timestamp)
for (auto& sel : ranges)
{
if (buffer.is_end(sel.anchor()))
sel.anchor() = buffer.back_coord();
if (buffer.is_end(sel.cursor()))
sel.cursor() = buffer.back_coord();
if (sel.anchor() != sel.cursor())
sel.cursor() = buffer.char_prev(sel.cursor());
}