summaryrefslogtreecommitdiffstats
path: root/kate/data/javascript.xml
diff options
context:
space:
mode:
Diffstat (limited to 'kate/data/javascript.xml')
-rw-r--r--kate/data/javascript.xml13
1 files changed, 12 insertions, 1 deletions
diff --git a/kate/data/javascript.xml b/kate/data/javascript.xml
index 260aa721a..dc124041e 100644
--- a/kate/data/javascript.xml
+++ b/kate/data/javascript.xml
@@ -3,7 +3,7 @@
<!-- Author: Anders Lund <anders@alweb.dk> //-->
<!-- Minor changes: Joseph Wenninger <jowenn@kde.org> //-->
<!-- Full JavaScript 1.0 support by Whitehawk Stormchaser //-->
-<language name="JavaScript" version="1.22" kateversion="2.4" section="Scripts" extensions="*.js;*.kwinscript"
+<language name="JavaScript" version="1.23" kateversion="2.4" section="Scripts" extensions="*.js;*.kwinscript"
mimetype="text/x-javascript;application/x-javascript" indenter="cstyle"
author="Anders Lund (anders@alweb.dk), Joseph Wenninger (jowenn@kde.org), Whitehawk Stormchaser (zerokode@gmx.net)" license="">
<highlighting>
@@ -64,6 +64,17 @@
<item> undefined </item>
</list>
<contexts>
+
+ <!-- Shebang: ("#!") Detect shebang and fallthrough to Normal -->
+ <!-- Based on the similar clause from prolog.xml, which notes the following BUG:
+ If the file starts with whitespace and a shebang on a line other than the first line,
+ this rule will still match it as a shebang, even tough the shebang is only valid on
+ the very first line.
+ -->
+ <context name="Shebang" lineEndContext="Normal" attribute="Syntax Error" fallthrough="true" fallthroughContext="Normal" >
+ <Detect2Chars column="0" char="#" char1="!" context="Comment" attribute="Comment" />
+ </context>
+
<context attribute="Normal Text" lineEndContext="#stay" name="Normal">
<DetectSpaces/>
<StringDetect attribute="Region Marker" context="region_marker" String="//BEGIN" beginRegion="Region1" />