Closed ghost closed 4 months ago
A simple change is following (#!
has no valid meaning in all C/C++ like languages):
diff --git a/lexers/LexCPP.cxx b/lexers/LexCPP.cxx
index f5ab166c..3c1bc74a 100644
--- a/lexers/LexCPP.cxx
+++ b/lexers/LexCPP.cxx
@@ -889,6 +889,11 @@ void SCI_METHOD LexerCPP::Lex(Sci_PositionU startPos, Sci_Position length, int i
const WordClassifier &classifierDocKeyWords = subStyles.Classifier(SCE_C_COMMENTDOCKEYWORD);
Sci_PositionU lineEndNext = styler.LineEnd(lineCurrent);
+ if (sc.currentPos == 0 && sc.Match('#', '!')) {
+ // Shell Shebang at beginning of file
+ sc.SetState(SCE_C_COMMENTLINE);
+ sc.Forward();
+ }
for (; sc.More();) {
I don't have much to say, another user previously reported this in detail in the Notepad++ directory, which uses Lexilla: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/14706
References: