From f858844a423305408ac133a665ab924a940480f8 Mon Sep 17 00:00:00 2001 From: CakesStuff <95542792+CakesStuff@users.noreply.github.com> Date: Sun, 14 Jan 2024 18:22:14 +0100 Subject: [PATCH] Fix memset issue in highlighting The previous memset used an incorrect variable causing various issues with single line comments. --- kilo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kilo.c b/kilo.c index 406eb7be..6fd04efc 100644 --- a/kilo.c +++ b/kilo.c @@ -412,7 +412,7 @@ void editorUpdateSyntax(erow *row) { /* Handle // comments. */ if (prev_sep && *p == scs[0] && *(p+1) == scs[1]) { /* From here to end is a comment */ - memset(row->hl+i,HL_COMMENT,row->size-i); + memset(row->hl+i,HL_COMMENT,row->rsize-i); return; }