summaryrefslogtreecommitdiff
path: root/src/selection.cc
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2017-07-14 16:16:43 +0900
committerMaxime Coste <mawww@kakoune.org>2017-07-14 16:16:43 +0900
commit6e40e57ed468a535d6a1a5b4dad6a9da50dc8276 (patch)
treeb76268223acb2a48241a0660bfc181ca25ce2800 /src/selection.cc
parent580eae03881190b108ffb896197af27d88935177 (diff)
Fix replacing reducing selections to their cursor
Broken by 8650c99f131aae8b10eb2141f7c2152fff25b7d1
Diffstat (limited to 'src/selection.cc')
-rw-r--r--src/selection.cc4
1 files 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<Selection>& 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);
}
}