# # # patch "commands.cc" # from [83c0ca592e23b9cf6a61fb553f2abf10bd80abc4] # to [03612a96ebcb165144d602f09a96344771522963] # ============================================================ --- commands.cc 83c0ca592e23b9cf6a61fb553f2abf10bd80abc4 +++ commands.cc 03612a96ebcb165144d602f09a96344771522963 @@ -310,46 +310,48 @@ namespace commands const size_t maxcol = terminal_width(); vector::const_iterator i = words.begin(); - while (i != words.end()) { + while (i != words.end()) + { string const & word = *i; - if (col + word.length() + 1 >= maxcol) { - out << std::endl; - col = 0; + if (col + word.length() + 1 >= maxcol) + { + out << std::endl; + col = 0; - // Skip empty words at the beginning of the line so that they do - // not mess with indentation. These "words" appear because we - // put two spaces between sentences, and one of these is - // transformed into a word. - // - // Another approach could be to simply omit these words (by - // modifying split_into_words) and then add this formatting (two - // spaces between sentences) from this algorithm. But then, - // other kinds of formatting could not be allowed in the original - // strings... (i.e., they'd disappear after we mangled them). - if (word == "") - { - do - i++; - while (i != words.end() && (*i) == ""); - if (i == words.end()) - break; - else - { - while (col++ < colabstract - 1) - out << ' '; - continue; - } - } + // Skip empty words at the beginning of the line so that they do + // not mess with indentation. These "words" appear because we + // put two spaces between sentences, and one of these is + // transformed into a word. + // + // Another approach could be to simply omit these words (by + // modifying split_into_words) and then add this formatting (two + // spaces between sentences) from this algorithm. But then, + // other kinds of formatting could not be allowed in the original + // strings... (i.e., they'd disappear after we mangled them). + if (word == "") + { + do + i++; + while (i != words.end() && (*i) == ""); + if (i == words.end()) + break; + else + { + while (col++ < colabstract - 1) + out << ' '; + continue; + } + } - while (col++ < colabstract - 1) - out << ' '; - } + while (col++ < colabstract - 1) + out << ' '; + } out << ' ' << word; col += word.length() + 1; i++; - } + } out << std::endl; }