[opensuse-kde3] katepart syntax/javascript.xml broken in 42.3
All, The javascript kate/kwrite syntax highlighting is broken on 42.3. I don't know what broke it. I have an older copy (newer version) that restores proper syntax highlighting for javascript. (I've attached the working file below) The changes from the working copy of the syntax hightlight file and the current opensuse broken one are: diff -uNb javascript.xml ~/tmp/javascript.xml --- javascript.xml 2014-01-19 05:59:20.000000000 -0600 +++ /home/david/tmp/javascript.xml 2014-07-14 05:03:17.000000000 -0500 @@ -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.23" kateversion="2.5" 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" /> @@ -102,16 +113,13 @@ <AnyChar attribute="Symbol" String=":!%&+,-/.*<=>?|~^;" /> </context> - <context attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop" name="Object Member"> + <context attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop" name="Object Member"> <DetectChar char="." /> <!--DetectIdentifier--> <RegExpr attribute="Objects" context="Object Member" String="[a-zA-Z_$][\w$]*(?=\s*\.)" /> <!--DetectIdentifier--> <RegExpr attribute="Object Member" String="[a-zA-Z_$][\w$]*" /> - <!-- NoRegExp without DetectSpaces. TODO: code reuse without detecting spaces as object member? --> - <Detect2Chars context="#pop" lookAhead="true" char="/" char1="/" /> - <Detect2Chars context="#pop" lookAhead="true" char="/" char1="*" /> - <DetectChar context="#pop" char="/" /> + <IncludeRules context="NoRegExp" /> </context> <context attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop" name="NoRegExp"> The working version is attached. May be worth a bug. We also need a kde3 repo for 15 - Go Ilya! -- David C. Rankin, J.D.,P.E.
On 06/08/2018 04:04 PM, David C. Rankin wrote:
All,
The javascript kate/kwrite syntax highlighting is broken on 42.3.
After debugging a bit, removing the following lines from the current restores javascript syntax highlighting in my install: lines 74-76 <!-- <context name="Shebang" lineEndContext="Normal" attribute="Syntax Error" fallthrough="true" fallthroughContext="Normal" > <Detect2Chars column="0" char="#" char1="!" context="Comment" attribute="Comment" /> </context> --> Can someone open a javascript file in kate and verify whether syntax highlight is working in your install with the current file and the current lines? I've verified with TDE that javascript highlighting is working with the current file there -- so I cannot explain why I have to comment the above lines to restore highlighting on my install. All master files are at: https://www.kate-editor.org/syntax/ The javascript.xml file is unchanged between the 2.4 and 3.15 folders. If it is working on your install, then there must be some combination of editor settings I'm using that is causing the problem. -- David C. Rankin, J.D.,P.E. -- To unsubscribe, e-mail: opensuse-kde3+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kde3+owner@opensuse.org
participants (1)
-
David C. Rankin