From 6e40e57ed468a535d6a1a5b4dad6a9da50dc8276 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Fri, 14 Jul 2017 16:16:43 +0900 Subject: [PATCH] Fix replacing reducing selections to their cursor Broken by 8650c99f131aae8b10eb2141f7c2152fff25b7d1 --- src/selection.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/selection.cc b/src/selection.cc index 1c39c8a7..5c8f2707 100644 --- a/src/selection.cc +++ b/src/selection.cc @@ -379,8 +379,8 @@ static void fix_overflowing_selections(Vector& selections, const BufferCoord back_coord = buffer.back_coord(); for (auto& sel : selections) { - auto pos = buffer.clamp(sel.cursor()); - sel.anchor() = sel.cursor() = std::min(pos, back_coord); + sel.cursor() = std::min(buffer.clamp(sel.cursor()), back_coord); + sel.anchor() = std::min(buffer.clamp(sel.anchor()), back_coord); } }