--template: fixed {code} output with tabs
This commit is contained in:
parent
74b1d1deb6
commit
84aaec26e6
|
@ -444,6 +444,9 @@ static std::string readCode(const std::string &file, unsigned int linenr, unsign
|
||||||
const std::string::size_type endPos = line.find_last_not_of("\r\n\t ");
|
const std::string::size_type endPos = line.find_last_not_of("\r\n\t ");
|
||||||
if (endPos + 1 < line.size())
|
if (endPos + 1 < line.size())
|
||||||
line.erase(endPos + 1);
|
line.erase(endPos + 1);
|
||||||
|
std::string::size_type pos = 0;
|
||||||
|
while ((pos = line.find("\t", pos)) != std::string::npos)
|
||||||
|
line[pos] = ' ';
|
||||||
return line + endl + std::string((column>0 ? column-1 : column), ' ') + '^';
|
return line + endl + std::string((column>0 ? column-1 : column), ' ') + '^';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue