diff --git a/src/main.cc b/src/main.cc index 7faf8712..94b0bd78 100644 --- a/src/main.cc +++ b/src/main.cc @@ -249,13 +249,24 @@ void quit(const CommandParameters& params, const Context& context) if (not force) { + std::vector names; for (auto& buffer : BufferManager::instance()) { if (buffer.type() != Buffer::Type::Scratch and buffer.is_modified()) + names.push_back(buffer.name()); + } + if (not names.empty()) + { + std::string message = "modified buffers remaining: ["; + for (auto it = names.begin(); it != names.end(); ++it) { - NCurses::print_status("modified buffer remaining"); - return; + if (it != names.begin()) + message += ", "; + message += *it; } + message += "]"; + NCurses::print_status(message); + return; } } quit_requested = true;