Fix replacing reducing selections to their cursor

Broken by 8650c99f13
This commit is contained in:
Maxime Coste 2017-07-14 16:16:43 +09:00
parent 580eae0388
commit 6e40e57ed4

View File

@ -379,8 +379,8 @@ static void fix_overflowing_selections(Vector<Selection>& selections,
const BufferCoord back_coord = buffer.back_coord(); const BufferCoord back_coord = buffer.back_coord();
for (auto& sel : selections) for (auto& sel : selections)
{ {
auto pos = buffer.clamp(sel.cursor()); sel.cursor() = std::min(buffer.clamp(sel.cursor()), back_coord);
sel.anchor() = sel.cursor() = std::min(pos, back_coord); sel.anchor() = std::min(buffer.clamp(sel.anchor()), back_coord);
} }
} }