minor code simplification
This commit is contained in:
parent
9effba2c66
commit
e77ca7a4be
|
@ -306,8 +306,7 @@ bool Editor::undo()
|
||||||
if (res)
|
if (res)
|
||||||
{
|
{
|
||||||
m_selections.clear();
|
m_selections.clear();
|
||||||
m_selections.push_back(Selection(listener.first(),
|
m_selections.emplace_back(listener.first(), listener.last());
|
||||||
listener.last()));
|
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
@ -319,8 +318,7 @@ bool Editor::redo()
|
||||||
if (res)
|
if (res)
|
||||||
{
|
{
|
||||||
m_selections.clear();
|
m_selections.clear();
|
||||||
m_selections.push_back(Selection(listener.first(),
|
m_selections.emplace_back(listener.first(), listener.last());
|
||||||
listener.last()));
|
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,13 +62,11 @@ struct SelectionAndCaptures
|
||||||
|
|
||||||
SelectionAndCaptures(const BufferIterator& first,
|
SelectionAndCaptures(const BufferIterator& first,
|
||||||
const BufferIterator& last,
|
const BufferIterator& last,
|
||||||
CaptureList captures_list)
|
CaptureList captures_list = {})
|
||||||
: selection(first, last), captures(std::move(captures_list)) {}
|
: selection(first, last), captures(std::move(captures_list)) {}
|
||||||
SelectionAndCaptures(const Selection& sel,
|
SelectionAndCaptures(const Selection& sel,
|
||||||
CaptureList captures_list)
|
CaptureList captures_list = {})
|
||||||
: selection(sel), captures(std::move(captures_list)) {}
|
: selection(sel), captures(std::move(captures_list)) {}
|
||||||
SelectionAndCaptures(const Selection& sel)
|
|
||||||
: selection(sel) {}
|
|
||||||
|
|
||||||
// helper to access the selection
|
// helper to access the selection
|
||||||
BufferIterator begin() const { return selection.begin(); }
|
BufferIterator begin() const { return selection.begin(); }
|
||||||
|
|
Loading…
Reference in New Issue
Block a user