From 4b6933a7cb5e0ef583071fffc0c97b829e72c684 Mon Sep 17 00:00:00 2001 From: Albert Cervin Date: Wed, 31 Jan 2024 23:24:02 +0100 Subject: Fix syntax predicate creation It is now created when parsing the queries. Also, make completion popup directly. --- src/dged/text.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/dged/text.c') diff --git a/src/dged/text.c b/src/dged/text.c index bc2b1fc..30036a0 100644 --- a/src/dged/text.c +++ b/src/dged/text.c @@ -184,10 +184,18 @@ void insert_at(struct text *text, uint32_t line, uint32_t col, uint8_t *data, } uint32_t text_line_length(struct text *text, uint32_t lineidx) { + if (lineidx >= text_num_lines(text)) { + return 0; + } + return text->lines[lineidx].nchars; } uint32_t text_line_size(struct text *text, uint32_t lineidx) { + if (lineidx >= text_num_lines(text)) { + return 0; + } + return text->lines[lineidx].nbytes; } -- cgit v1.2.3