diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2015-04-19 15:00:37 +0100 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2015-04-19 15:00:37 +0100 |
| commit | 9f65a4e6dd735ecdcb4b469b485ff643cd1f54fe (patch) | |
| tree | f606eb06aaaf75395bdec2833956e7d03f80c840 /src | |
| parent | b570c68c75314cb58be5a22f0a6afd310c0efca2 (diff) | |
Remove Context::set_selections, use Context::selections() = ...
Diffstat (limited to 'src')
| -rw-r--r-- | src/context.cc | 6 | ||||
| -rw-r--r-- | src/context.hh | 1 | ||||
| -rw-r--r-- | 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<String> Context::selections_content() const return contents; } -void Context::set_selections(Vector<Selection> 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<String> selections_content() const; - void set_selections(Vector<Selection> 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<bool indent_empty = false> @@ -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(); } |
