From 90fc24ed041736d6cdebc74e5fd2e260e3803c3b Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sat, 29 Jan 2022 12:13:35 -0800 Subject: fixup! redo lua vs prose Forgot to include some hunks. --- src/kilo.c | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/kilo.c b/src/kilo.c index 28edeaf..c7754e4 100644 --- a/src/kilo.c +++ b/src/kilo.c @@ -275,24 +275,26 @@ static void editorUpdateSyntax(erow *row) { } /* Handle "" and '' */ - if (in_string) { - row->hl[i] = HL_STRING; - if (*p == '\\' && *(p+1)) { - row->hl[i+1] = HL_STRING; - p += 2; i += 2; - prev_sep = 0; - continue; - } - if (*p == in_string) in_string = 0; - p++; i++; - continue; - } else { - if (*p == '"' || *p == '\'') { - in_string = *p; + if (E.syntax == &LuaSyntax) { // obscene hack + if (in_string) { row->hl[i] = HL_STRING; + if (*p == '\\' && *(p+1)) { + row->hl[i+1] = HL_STRING; + p += 2; i += 2; + prev_sep = 0; + continue; + } + if (*p == in_string) in_string = 0; p++; i++; - prev_sep = 0; continue; + } else { + if (*p == '"' || *p == '\'') { + in_string = *p; + row->hl[i] = HL_STRING; + p++; i++; + prev_sep = 0; + continue; + } } } -- cgit 1.4.1-2-gfad0