From 9f65a4e6dd735ecdcb4b469b485ff643cd1f54fe Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sun, 19 Apr 2015 15:00:37 +0100 Subject: [PATCH] Remove Context::set_selections, use Context::selections() = ... --- src/context.cc | 6 ------ src/context.hh | 1 - src/normal.cc | 8 ++++---- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/src/context.cc b/src/context.cc index 3612d7f5..ca186cb1 100644 --- a/src/context.cc +++ b/src/context.cc @@ -211,12 +211,6 @@ Vector Context::selections_content() const return contents; } -void Context::set_selections(Vector sels) -{ - *m_selections = std::move(sels); - (*m_selections).check_invariant(); -} - void Context::begin_edition() { if (m_edition_level >= 0) diff --git a/src/context.hh b/src/context.hh index 83323994..4ff765de 100644 --- a/src/context.hh +++ b/src/context.hh @@ -89,7 +89,6 @@ public: SelectionList& selections(); const SelectionList& selections() const; Vector selections_content() const; - void set_selections(Vector sels); void change_buffer(Buffer& buffer); diff --git a/src/normal.cc b/src/normal.cc index e4d22cc6..7f737032 100644 --- a/src/normal.cc +++ b/src/normal.cc @@ -766,7 +766,7 @@ void keep(Context& context, NormalParams) } if (keep.empty()) throw runtime_error("no selections remaining"); - context.set_selections(std::move(keep)); + context.selections() = std::move(keep); }); } @@ -788,7 +788,7 @@ void keep_pipe(Context& context, NormalParams) } if (keep.empty()) throw runtime_error("no selections remaining"); - context.set_selections(std::move(keep)); + context.selections() = std::move(keep); }); } template @@ -1267,7 +1267,7 @@ void undo(Context& context, NormalParams) { auto ranges = compute_modified_ranges(buffer, timestamp); if (not ranges.empty()) - context.set_selections(std::move(ranges)); + context.selections() = std::move(ranges); context.selections().avoid_eol(); } else if (not res) @@ -1284,7 +1284,7 @@ void redo(Context& context, NormalParams) { auto ranges = compute_modified_ranges(buffer, timestamp); if (not ranges.empty()) - context.set_selections(std::move(ranges)); + context.selections() = std::move(ranges); context.selections().avoid_eol(); }