diff options
| author | Albert Cervin <albert@acervin.com> | 2024-01-31 23:24:02 +0100 |
|---|---|---|
| committer | Albert Cervin <albert@acervin.com> | 2024-01-31 23:24:02 +0100 |
| commit | 4b6933a7cb5e0ef583071fffc0c97b829e72c684 (patch) | |
| tree | cb608d7d3929fd1a32010b11be751fe2b741eeee /src/dged/text.c | |
| parent | ef64c4d05794484e5affbf633f095877cc1422df (diff) | |
| download | dged-4b6933a7cb5e0ef583071fffc0c97b829e72c684.tar.gz dged-4b6933a7cb5e0ef583071fffc0c97b829e72c684.tar.xz dged-4b6933a7cb5e0ef583071fffc0c97b829e72c684.zip | |
Fix syntax predicate creation
It is now created when parsing the queries.
Also, make completion popup directly.
Diffstat (limited to 'src/dged/text.c')
| -rw-r--r-- | src/dged/text.c | 8 |
1 files changed, 8 insertions, 0 deletions
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; } |
