From 84aaec26e68145af49785bfdf04014d0ee5b21b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Mon, 23 Apr 2018 14:11:33 +0200 Subject: [PATCH] --template: fixed {code} output with tabs --- lib/errorlogger.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/errorlogger.cpp b/lib/errorlogger.cpp index bde69d76e..828000dbc 100644 --- a/lib/errorlogger.cpp +++ b/lib/errorlogger.cpp @@ -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 "); if (endPos + 1 < line.size()) 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), ' ') + '^'; }