nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nano-devel] [PATCH] syntax: lua: do not color strings inside comments,


From: Benno Schulenberg
Subject: [Nano-devel] [PATCH] syntax: lua: do not color strings inside comments, and add a linter
Date: Sat, 18 Aug 2018 11:37:32 +0200

From: Mark-Weston <address@hidden>

Also, don't partially color "..." as an operator, because it isn't,
and color also the unary operator "#".

Signed-off-by: Mark-Weston <address@hidden>
---
 syntax/lua.nanorc | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/syntax/lua.nanorc b/syntax/lua.nanorc
index a125d1bd..79685090 100644
--- a/syntax/lua.nanorc
+++ b/syntax/lua.nanorc
@@ -5,12 +5,15 @@
 
 syntax lua "\.lua$"
 magic "Lua script"
+linter "luacheck --no-color"
 comment "--"
 
 color brightwhite "\[\[.*\]\]"
 
 # Operators
-color brightyellow ":|\*|/|%|\+|-|\^|>|>=|<|<=|~=|=|\.\.|\<(not|and|or)\>"
+color brightyellow ":|\*|/|%|\+|-|\^|>|>=|<|<=|~=|=|\.\.|#|\<(not|and|or)\>"
+# Don't partially color ... as an operator
+color normal "\.\.\."
 
 # Statements
 color brightblue 
"\<(do|end|while|repeat|until|if|elseif|then|else|for|in|function|local|return|break)\>"
@@ -49,9 +52,9 @@ color brightmagenta "\(|\)|\[|\]|\{|\}"
 # Shebang
 color brightcyan "^#!.*"
 
+# Strings
+color red ""(\\.|[^"\])*"|'(\\.|[^'\])*'"
+
 # Simple comments and multiline comments
 color green "--.*"
 color green start="--\[\[" end="\]\]"
-
-# Strings
-color red ""(\\.|[^"\])*"|'(\\.|[^'\])*'"
-- 
2.17.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]