From 8271ebfbbf820bcc539f9cf25eecf1754191a018 Mon Sep 17 00:00:00 2001 From: jedailey Date: Sat, 14 Jan 2017 09:59:45 +1100 Subject: Require the first line to start with "#!" to be treated as a shebang comment. --- lexers/LexLua.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lexers') diff --git a/lexers/LexLua.cxx b/lexers/LexLua.cxx index 1e115ad18..1086b40e8 100644 --- a/lexers/LexLua.cxx +++ b/lexers/LexLua.cxx @@ -89,8 +89,8 @@ static void ColouriseLuaDoc( } StyleContext sc(startPos, length, initStyle, styler); - if (startPos == 0 && sc.ch == '#') { - // shbang line: # is a comment only if first char of the script + if (startPos == 0 && sc.ch == '#' && sc.chNext == '!') { + // shbang line: "#!" is a comment only if located at the start of the script sc.SetState(SCE_LUA_COMMENTLINE); } for (; sc.More(); sc.Forward()) { -- cgit v1.2.3