Fix small misbehaviour in split_selections

This commit is contained in:
Maxime Coste 2014-01-04 14:23:08 +00:00
parent 540d82c452
commit 8168cba1a3

View File

@ -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()); result.emplace_back(begin.coord(), (begin == end) ? end.coord() : utf8::previous(end).coord());
begin = (*re_it)[0].second; 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); result.set_main_index(result.size() - 1);
selections = std::move(result); selections = std::move(result);