From 9e3c3310422f9253b7255b18b1dcdb7f20af3e35 Mon Sep 17 00:00:00 2001 From: Albert Cervin Date: Wed, 31 Jan 2024 15:39:08 +0100 Subject: Handle empty buffers in highlighting --- src/dged/syntax.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/dged') diff --git a/src/dged/syntax.c b/src/dged/syntax.c index 403cabe..e7828a5 100644 --- a/src/dged/syntax.c +++ b/src/dged/syntax.c @@ -279,6 +279,10 @@ static void update_parser(struct buffer *buffer, void *userdata, return; } + if (buffer_is_empty(buffer)) { + return; + } + // take results and set text properties // TODO: can reuse the cursor TSQueryCursor *cursor = ts_query_cursor_new(); -- cgit v1.2.3