Editor: add a ReplaceLast select mode
This commit is contained in:
parent
9fb0129061
commit
02b9fcc3df
|
@ -241,6 +241,8 @@ void Editor::select(const Selection& selection, SelectMode mode)
|
|||
m_selections.push_back(selection);
|
||||
sort_and_merge_overlapping(m_selections);
|
||||
}
|
||||
else
|
||||
assert(false);
|
||||
check_invariant();
|
||||
}
|
||||
|
||||
|
@ -262,6 +264,11 @@ void Editor::select(const Selector& selector, SelectMode mode)
|
|||
res.captures() = sel.captures();
|
||||
m_selections.push_back(res);
|
||||
}
|
||||
else if (mode == SelectMode::ReplaceLast)
|
||||
{
|
||||
auto& sel = m_selections.back();
|
||||
sel = selector(sel);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (auto& sel : m_selections)
|
||||
|
|
|
@ -18,6 +18,7 @@ enum class SelectMode
|
|||
Replace,
|
||||
Extend,
|
||||
Append,
|
||||
ReplaceLast,
|
||||
};
|
||||
|
||||
enum class InsertMode : unsigned
|
||||
|
|
Loading…
Reference in New Issue
Block a user