Editor: fix select(Selection&, SelectMode::Replace)

This commit is contained in:
Maxime Coste 2013-03-20 19:05:05 +01:00
parent 07a2c2944f
commit d99fe87b43

View File

@ -241,7 +241,10 @@ void Editor::remove_selection(int index)
void Editor::select(const Selection& selection, SelectMode mode)
{
if (mode == SelectMode::Replace)
{
m_selections = SelectionList{ selection };
m_main_sel = 0;
}
else if (mode == SelectMode::Extend)
{
m_selections[m_main_sel].merge_with(selection);