diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2014-06-01 16:01:38 +0100 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2014-06-01 16:01:38 +0100 |
| commit | a5e028e1b16f1fc802b8dcee26791e8c64ac2aea (patch) | |
| tree | 67b80331ee83632b7724114a8b112f4ac561bc5e /src/normal.cc | |
| parent | 1b30c0f4fbc9bad48d0689fd748206ce7072b38d (diff) | |
Add Context::set_selections(std::vector<Selection>)
This methods avoids updating the context selection needlessly as
they are going to get replaced anyway.
Diffstat (limited to 'src/normal.cc')
| -rw-r--r-- | src/normal.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/normal.cc b/src/normal.cc index 92e5727a..5cc013df 100644 --- a/src/normal.cc +++ b/src/normal.cc @@ -725,7 +725,7 @@ void keep(Context& context, int) } if (keep.empty()) throw runtime_error("no selections remaining"); - context.selections() = std::move(keep); + context.set_selections(std::move(keep)); }); } @@ -749,7 +749,7 @@ void keep_pipe(Context& context, int) } if (keep.empty()) throw runtime_error("no selections remaining"); - context.selections() = std::move(keep); + context.set_selections(std::move(keep)); }); } template<bool indent_empty = false> @@ -1213,7 +1213,7 @@ void undo(Context& context, int) { auto ranges = compute_modified_ranges(buffer, timestamp); if (not ranges.empty()) - context.selections() = std::move(ranges); + context.set_selections(std::move(ranges)); } else if (not res) context.print_status({ "nothing left to undo", get_color("Information") }); @@ -1229,7 +1229,7 @@ void redo(Context& context, int) { auto ranges = compute_modified_ranges(buffer, timestamp); if (not ranges.empty()) - context.selections() = std::move(ranges); + context.set_selections(std::move(ranges)); } else if (not res) |
