diff --git a/include/cxxopts.hpp b/include/cxxopts.hpp index d56f194..e4bb8c3 100644 --- a/include/cxxopts.hpp +++ b/include/cxxopts.hpp @@ -1415,7 +1415,12 @@ namespace cxxopts lastSpace = current; } - if (size > width) + if (*current == '\n') + { + startLine = current + 1; + lastSpace = startLine; + } + else if (size > width) { if (lastSpace == startLine) {