From 8168cba1a30a0d355065efb72ebcb11304a34bb9 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sat, 4 Jan 2014 14:23:08 +0000 Subject: [PATCH] Fix small misbehaviour in split_selections --- src/selectors.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/selectors.cc b/src/selectors.cc index c8841f41..91869c5c 100644 --- a/src/selectors.cc +++ b/src/selectors.cc @@ -457,7 +457,8 @@ void split_selections(const Buffer& buffer, SelectionList& selections, result.emplace_back(begin.coord(), (begin == end) ? end.coord() : utf8::previous(end).coord()); begin = (*re_it)[0].second; } - result.emplace_back(begin.coord(), sel.max()); + if (begin.coord() <= sel.max()) + result.emplace_back(begin.coord(), sel.max()); } result.set_main_index(result.size() - 1); selections = std::move(result);