Fix double check_invariant in SelectionList construction, and set main selection to last

This commit is contained in:
Maxime Coste 2015-11-04 19:53:47 +00:00
parent 2ce0a5a8a8
commit d6a2d77857

View File

@ -22,23 +22,18 @@ SelectionList::SelectionList(Buffer& buffer, Selection s, size_t timestamp)
} }
SelectionList::SelectionList(Buffer& buffer, Selection s) SelectionList::SelectionList(Buffer& buffer, Selection s)
: SelectionList(buffer, std::move(s), buffer.timestamp()) : SelectionList(buffer, std::move(s), buffer.timestamp()) {}
{
check_invariant();
}
SelectionList::SelectionList(Buffer& buffer, Vector<Selection> s, size_t timestamp) SelectionList::SelectionList(Buffer& buffer, Vector<Selection> s, size_t timestamp)
: m_buffer(&buffer), m_selections(std::move(s)), m_timestamp(timestamp) : m_buffer(&buffer), m_selections(std::move(s)), m_timestamp(timestamp)
{ {
kak_assert(size() > 0); kak_assert(size() > 0);
m_main = size() - 1;
check_invariant(); check_invariant();
} }
SelectionList::SelectionList(Buffer& buffer, Vector<Selection> s) SelectionList::SelectionList(Buffer& buffer, Vector<Selection> s)
: SelectionList(buffer, std::move(s), buffer.timestamp()) : SelectionList(buffer, std::move(s), buffer.timestamp()) {}
{
check_invariant();
}
namespace namespace
{ {