From 8bfb7da674cdd986ff8044042190473ab665a7a4 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 27 Dec 2012 18:56:06 +0100 Subject: [PATCH] fix splitting with inverted selection --- src/selectors.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/selectors.cc b/src/selectors.cc index 84f5ab98..39a473d7 100644 --- a/src/selectors.cc +++ b/src/selectors.cc @@ -463,7 +463,8 @@ SelectionList split_selection(const Selection& selection, result.push_back(Selection(begin, (begin == end) ? end : utf8::previous(end))); begin = (*re_it)[0].second; } - result.push_back(Selection(begin, selection.last())); + result.push_back(Selection(begin, std::max(selection.first(), + selection.last()))); return result; } catch (boost::regex_error& err)