From 63f54d13aa7233986f784ef857faef259a889ed6 Mon Sep 17 00:00:00 2001 From: pommicket Date: Thu, 23 Mar 2023 13:22:16 -0400 Subject: go-to-build-error now also detects rust ::: references --- buffer.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'buffer.c') diff --git a/buffer.c b/buffer.c index 3f25142..c440ed4 100644 --- a/buffer.c +++ b/buffer.c @@ -308,6 +308,9 @@ bool buffer_indent_with_spaces(TextBuffer *buffer) { } String32 buffer_get_line(TextBuffer *buffer, u32 line_number) { + if (line_number >= buffer->nlines) { + return str32(NULL, 0); + } Line *line = &buffer->lines[line_number]; return (String32) { .str = line->str, .len = line->len -- cgit v1.2.3