X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLexer.cpp;h=098faa9737282c3fc40458ec67665b26b8b881ef;hb=175711046db2b986550318fa78d901628de28cb8;hp=becd157886cd3d1952469e741a02ff810bfc996c;hpb=e30f3d76d2bee0011ceaeb5f0cc221156458cbad;p=lyx.git diff --git a/src/Lexer.cpp b/src/Lexer.cpp index becd157886..098faa9737 100644 --- a/src/Lexer.cpp +++ b/src/Lexer.cpp @@ -738,7 +738,7 @@ docstring Lexer::getLongString(docstring const & endtoken) break; if (firstline) { - size_t i = tmpstr.find_first_not_of(char_type(' ')); + size_t i = tmpstr.find_first_not_of(from_ascii(" \t")); if (i != string::npos) prefix = tmpstr.substr(0, i); firstline = false; @@ -747,10 +747,10 @@ docstring Lexer::getLongString(docstring const & endtoken) // further lines in long strings may have the same // whitespace prefix as the first line. Remove it. - if (prefix.length() && prefixIs(tmpstr, prefix)) - tmpstr.erase(0, prefix.length() - 1); + if (!prefix.empty() && prefixIs(tmpstr, prefix)) + tmpstr.erase(0, prefix.length()); - str += ltrim(tmpstr, "\t") + '\n'; + str += tmpstr + '\n'; } if (!pimpl_->is)