diff --git a/src/TextRenderer.cpp b/src/TextRenderer.cpp index 902d0f1..2621c01 100644 --- a/src/TextRenderer.cpp +++ b/src/TextRenderer.cpp @@ -168,7 +168,7 @@ std::string TextRenderer::adjustText(std::string newText) { } if(currentLine == startLine) { - return newText.substr(i, newText.size()); + return newText.substr(i + 1, newText.size()); } } } @@ -193,6 +193,8 @@ std::string TextRenderer::adjustText(std::string newText, int startLine, int end if(currentLine == endLine) { endIndex = i; + + return newText.substr(startIndex + 1, endIndex); } } else if (newText[i] != specialCharacter) { characterNumberOfCurrentLine++; @@ -206,10 +208,14 @@ std::string TextRenderer::adjustText(std::string newText, int startLine, int end if(currentLine == endLine) { endIndex = i; + + return newText.substr(startIndex + 1, endIndex); } } } } + + std::cout << "Fehler!! when adjust string." << std::endl; return std::string(); }