From a4fbaf95ffc73e9ce93fca65aa8e223bef2da799 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Wed, 16 Nov 2011 08:44:33 +0300 Subject: [PATCH] syntax/lua: highlight '\\' escape (and similar) properly The following example breaks highlighting to the end of file: local a = "\\" local b = 1 ... Added escape handling for simplest cases both for single-quoted and double-quoted literals: '\\', '\n' (and similar), '\d', '\dd', '\ddd' Signed-off-by: Sergei Trofimovich --- misc/syntax/lua.syntax | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/misc/syntax/lua.syntax b/misc/syntax/lua.syntax index 67ef621eb..97f8417dc 100644 --- a/misc/syntax/lua.syntax +++ b/misc/syntax/lua.syntax @@ -205,8 +205,7 @@ context exclusive -- \n brown context linestart # \n brown # Strings -context " " brightgreen - # can't find good color for the patterns highlight. +context " " green keyword %a brightgreen keyword %c brightgreen keyword %d brightgreen @@ -217,8 +216,31 @@ context " " brightgreen keyword %w brightgreen keyword %x brightgreen keyword %z brightgreen + keyword \\\\ brightgreen keyword \\" brightgreen + keyword \\' brightgreen + keyword \\\{abtnvfr\} brightgreen + keyword \\\{0123\}\{01234567\}\{01234567\} brightgreen + keyword \\\{01234567\}\{01234567\} brightgreen + keyword \\\{01234567\} brightgreen spellcheck -context ' ' brightgreen +context ' ' green + keyword %a brightgreen + keyword %c brightgreen + keyword %d brightgreen + keyword %l brightgreen + keyword %p brightgreen + keyword %s brightgreen + keyword %u brightgreen + keyword %w brightgreen + keyword %x brightgreen + keyword %z brightgreen + keyword \\\\ brightgreen + keyword \\" brightgreen + keyword \\' brightgreen + keyword \\\{abtnvfr\} brightgreen + keyword \\\{0123\}\{01234567\}\{01234567\} brightgreen + keyword \\\{01234567\}\{01234567\} brightgreen + keyword \\\{01234567\} brightgreen spellcheck