diff --git a/src/output.cpp b/src/output.cpp index 19bd72f..df3724d 100644 --- a/src/output.cpp +++ b/src/output.cpp @@ -78,22 +78,25 @@ void print_matches(const std::vector &matches, { metadata.emplace_back("page " + match.page); } - if (!opts.nocolor) + if (!metadata.empty()) { - cout << termcolor::italic; - } - for (const auto &part : metadata) - { - cout << part; - if (part != *(metadata.rbegin())) + if (!opts.nocolor) { - cout << ", "; + cout << termcolor::italic; + } + for (const auto &part : metadata) + { + cout << part; + if (part != *(metadata.rbegin())) + { + cout << ", "; + } + } + cout << ": "; + if (!opts.nocolor) + { + cout << termcolor::reset; } - } - cout << ": "; - if (!opts.nocolor) - { - cout << termcolor::reset; } cout << match.context.first; if (!opts.nocolor)