Skip to content

Commit 7cbc1ac

Browse files
authored
fix: arrows off by one if error line length > 40 (WerWolv#179)
* fix: arrows off by one if error line length > 40 and also fixed column numbers of error when input file had tabs that were replaced by less than 4 spaces. * build: update libwolv
1 parent 9954c25 commit 7cbc1ac

3 files changed

Lines changed: 3 additions & 4 deletions

File tree

lib/source/pl/core/error.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ namespace pl::core::err::impl {
4040
}
4141
}
4242
errorLine = errorLine.substr(start, end - start);
43-
arrowPosition = column - start;
43+
arrowPosition = column - start - 1;
4444
}
4545

4646
result += fmt::format("{}{}\n", lineNumberPrefix, errorLine);

lib/source/pl/pattern_language.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,7 @@ namespace pl {
194194
this->m_runningTime = std::chrono::duration_cast<std::chrono::duration<double>>(endTime - startTime).count();
195195
};
196196

197-
code = wolv::util::replaceStrings(code, "\r\n", "\n");
198-
code = wolv::util::replaceStrings(code, "\t", " ");
197+
code = wolv::util::preprocessText(code);
199198

200199
const auto &evaluator = this->m_internals.evaluator;
201200

0 commit comments

Comments
 (0)