diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2012-08-08 19:36:40 +0200 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2012-08-08 19:36:40 +0200 |
| commit | ce99856bfa15ca8212ba19b01568d59eeb4e62ca (patch) | |
| tree | 6bf66f84bc8f6016f280c3c74775a8f0b6a0b66d /src/commands.cc | |
| parent | b29b75aa81dd9ca50394406569d8837cff562005 (diff) | |
Refactor BufferManager
Diffstat (limited to 'src/commands.cc')
| -rw-r--r-- | src/commands.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/commands.cc b/src/commands.cc index 5b0f4b4c..38dc1225 100644 --- a/src/commands.cc +++ b/src/commands.cc @@ -293,8 +293,8 @@ void quit(const CommandParameters& params, Context& context) std::vector<String> names; for (auto& buffer : BufferManager::instance()) { - if (buffer.type() != Buffer::Type::Scratch and buffer.is_modified()) - names.push_back(buffer.name()); + if (buffer->type() != Buffer::Type::Scratch and buffer->is_modified()) + names.push_back(buffer->name()); } if (not names.empty()) { @@ -355,11 +355,11 @@ void delete_buffer(const CommandParameters& params, Context& context) { if (manager.count() == 1) throw runtime_error("buffer " + buffer->name() + " is the last one"); - for (Buffer& buf : manager) + for (auto& buf : manager) { - if (&buf != buffer) + if (buf != buffer) { - context = Context(*buf.get_or_create_window()); + context = Context(*buf->get_or_create_window()); break; } } |
