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