summaryrefslogtreecommitdiff
path: root/buffer.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-03-23 13:22:16 -0400
committerpommicket <pommicket@gmail.com>2023-03-23 13:22:16 -0400
commit63f54d13aa7233986f784ef857faef259a889ed6 (patch)
tree32e658f2de4505c90beda98091f53d212054cccc /buffer.c
parent000d571290008378ae64109f7dcb5947d452ef41 (diff)
go-to-build-error now also detects rust ::: references
Diffstat (limited to 'buffer.c')
-rw-r--r--buffer.c3
1 files changed, 3 insertions, 0 deletions
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