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. --- doc/ScintillaHistory.html | 5 +++++ lexers/LexLua.cxx | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index 39afda215..80d7c8e73 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -525,6 +525,11 @@ Released 30 December 2016.
  • + The Lua lexer requires the first line to start with "#!" to be treated as a shebang comment, + not just "#". + Bug #1900. +
  • +
  • The Python lexer partly supports f-strings, allows Unicode identifiers, and no longer allows @1 to be a decorator. Bug #1848.
  • 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