diff --git a/lib/token.cpp b/lib/token.cpp index dbb749488..d2d71660c 100644 --- a/lib/token.cpp +++ b/lib/token.cpp @@ -909,11 +909,12 @@ void Token::insertToken(const std::string &tokenStr, const std::string &original newToken->str(tokenStr); if (!originalNameStr.empty()) newToken->originalName(originalNameStr); - newToken->_linenr = _linenr; - newToken->_fileIndex = _fileIndex; - newToken->_progressValue = _progressValue; if (newToken != this) { + newToken->_linenr = _linenr; + newToken->_fileIndex = _fileIndex; + newToken->_progressValue = _progressValue; + if (prepend) { /*if (this->previous())*/ { newToken->previous(this->previous());