diff --git a/src/selection.cc b/src/selection.cc index 4724e896..14879386 100644 --- a/src/selection.cc +++ b/src/selection.cc @@ -183,7 +183,7 @@ Vector compute_modified_ranges(Buffer& buffer, size_t timestamp) } auto touches = [&](const Selection& lhs, const Selection& rhs) { - return buffer.char_next(lhs.max()) >= rhs.min(); + return lhs.max() == end_coord or buffer.char_next(lhs.max()) >= rhs.min(); }; size_t dummy = 0; ranges.erase(merge_overlapping(ranges.begin(), ranges.end(), dummy, touches), ranges.end()); diff --git a/test/regression/0-undo-change-at-eof/cmd b/test/regression/0-undo-change-at-eof/cmd new file mode 100644 index 00000000..b2bb8707 --- /dev/null +++ b/test/regression/0-undo-change-at-eof/cmd @@ -0,0 +1 @@ +yjxRu diff --git a/test/regression/0-undo-change-at-eof/in b/test/regression/0-undo-change-at-eof/in new file mode 100644 index 00000000..cc60e6f5 --- /dev/null +++ b/test/regression/0-undo-change-at-eof/in @@ -0,0 +1,2 @@ +copy +paste diff --git a/test/regression/0-undo-change-at-eof/out b/test/regression/0-undo-change-at-eof/out new file mode 100644 index 00000000..cc60e6f5 --- /dev/null +++ b/test/regression/0-undo-change-at-eof/out @@ -0,0 +1,2 @@ +copy +paste