Bug 365171 - [PATCH] Python syntax highlighting: not working correctly for escape sequences
Summary: [PATCH] Python syntax highlighting: not working correctly for escape sequences
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: syntax (show other bugs)
Version: unspecified
Platform: Other All
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-06 20:43 UTC by Lukas Sommer
Modified: 2016-09-05 18:45 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
python.xml (25.51 KB, application/xml)
2016-07-06 20:44 UTC, Lukas Sommer
Details
python.xml (25.66 KB, application/xml)
2016-08-12 18:32 UTC, Lukas Sommer
Details
python.xml (25.51 KB, text/plain)
2016-09-05 17:19 UTC, Lukas Sommer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lukas Sommer 2016-07-06 20:43:32 UTC
[PATCH] Python syntax highlighting: not working correctly for escape sequences

The syntax highlighting file python.xml in version 5.22 does not highlight correctly escape sequences. The highlighting for two-digit hex values is C-style, but Python’s syntax is different. There is no support for the other escape sequences. That‘s a little bit annoying when you have to work a lot with escape sequences.

Attached a new python.xml file that solves these issues. I have tested it while working in KDevelop 4.7.

Reproducible: Always
Comment 1 Lukas Sommer 2016-07-06 20:44:33 UTC
Created attachment 99902 [details]
python.xml
Comment 2 Martin Walch 2016-08-12 07:42:01 UTC
Looks like something got lost in lines 518—520:

<!-- As this highlighting style is for both, Python 2 and 3,
we do not know if a normal string is “unicode” or not. So we
-->
Comment 3 Lukas Sommer 2016-08-12 18:32:53 UTC
Created attachment 100567 [details]
python.xml

The documentation has been fixed.
Comment 4 Christoph Cullmann 2016-09-05 12:51:11 UTC
In ktexteditor.git, we already have version 2.28 of python.xml, could you rebase your change on that?
Comment 5 Lukas Sommer 2016-09-05 17:19:05 UTC
Created attachment 100940 [details]
python.xml

Rebased against 2.28 like in https://quickgit.kde.org/?p=ktexteditor.git&a=blob&hb=2ee8046be4aa7a15fb739352d82c73a2949777db&f=src%2Fsyntax%2Fdata%2Fpython.xml

However I could not test it, because now it’s KDE5 only. So testing in KDevelop 4.7 does not work anymore. And I did not figure out how to test a new syntax hightlighting file in KWrite/Kate in KDE5.
Comment 6 Christoph Cullmann 2016-09-05 18:30:26 UTC
Ok, will try out and push ;=) Thanks for the patch, btw.!!
Comment 7 Christoph Cullmann 2016-09-05 18:45:56 UTC
Git commit 7aa402317366198bada262da0364d2f0af427ecb by Christoph Cullmann.
Committed on 05/09/2016 at 18:44.
Pushed by cullmann into branch 'master'.

Bug 365171 - Python syntax highlighting: not working correctly for escape sequences

Patch by Lukas Sommer

Added deps for generated index to ensure we regenerate the qrc

M  +1    -1    src/CMakeLists.txt
M  +6    -0    src/syntax/data/CMakeLists.txt
M  +19   -5    src/syntax/data/python.xml

http://commits.kde.org/ktexteditor/7aa402317366198bada262da0364d2f0af427ecb