#include "dynamic_selection_list.hh" namespace Kakoune { DynamicSelectionList::DynamicSelectionList(const Buffer& buffer, SelectionList selections) : SelectionList(std::move(selections)), BufferChangeListener_AutoRegister(buffer) { check_invariant(); } DynamicSelectionList& DynamicSelectionList::operator=(SelectionList selections) { SelectionList::operator=(std::move(selections)); check_invariant(); return *this; } void DynamicSelectionList::check_invariant() const { #ifdef KAK_DEBUG const Buffer* buf = &buffer(); for (auto& sel : *this) { assert(buf == &sel.buffer()); sel.check_invariant(); } #endif } namespace { template