diff options
| author | Feoramund <161657516+Feoramund@users.noreply.github.com> | 2024-06-14 13:02:54 -0400 |
|---|---|---|
| committer | Feoramund <161657516+Feoramund@users.noreply.github.com> | 2024-06-14 13:02:54 -0400 |
| commit | 8626d38db10f134f97ea36d34ceda072a137e779 (patch) | |
| tree | c3e2d2e1da4e4f72bd6c6b80ee6e505372e7e165 /src/parser.cpp | |
| parent | ca481dc52d86a6856abba7481bc849a864f0183d (diff) | |
Fix displaying emptiness when error is on first line
Diffstat (limited to 'src/parser.cpp')
| -rw-r--r-- | src/parser.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/parser.cpp b/src/parser.cpp index 468f4749f..2f764c753 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -64,6 +64,11 @@ gb_internal gbString get_file_line_as_string(TokenPos const &pos, i32 *offset_) } line_start -= 1; } + if (line_start == start - 1) { + // Prevent an error on the first line from stepping behind the boundary + // of the text. + line_start += 1; + } while (line_end < end) { if (*line_end == '\n') { |