Bug 440038 - Special highlight for C++ raw string delimiters
Summary: Special highlight for C++ raw string delimiters
Status: RESOLVED FIXED
Alias: None
Product: frameworks-syntax-highlighting
Classification: Frameworks and Libraries
Component: syntax (show other bugs)
Version: 5.84.0
Platform: unspecified Unspecified
: NOR wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-19 14:35 UTC by Laura David Hurka
Modified: 2021-08-14 15:24 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Laura David Hurka 2021-07-19 14:35:57 UTC
SUMMARY
C++ raw string are recognized correctly. For example, writing the following in a .cpp file highlights the whole line as C++ string:

> R"raw(abcdef)wrong"  // This raw string looks shorter that it is.   )raw"

However, the whole line is highlighted in only one style. It would be helpful, if the syntax highlight in this case differentiates between the delimiters R"raw( and )raw", and the content.
This is currently not configurable, the whole raw string is just a “C++ String”.

I would like to change the highlight only for the delimiters.

SOFTWARE VERSIONS
KDE Frameworks Version: 5.85
Comment 1 Jan Paul Batrina 2021-07-22 13:08:03 UTC
(I'm not sure why the merge request is not being picked up by the Bug Janitor Service, but here's an MR implementing this)

https://invent.kde.org/frameworks/syntax-highlighting/-/merge_requests/228
Comment 2 Christoph Cullmann 2021-08-14 15:24:39 UTC
Git commit 61b6d9d1198a55a4dbc629b49f289c9604fdbcfb by Christoph Cullmann, on behalf of Jan Paul Batrina.
Committed on 14/08/2021 at 15:24.
Pushed by cullmann into branch 'master'.

isocpp.xml: Highlight raw string delimeters

Highlighting "delim" in R"delim(content)delim"
helps in differentiating the raw string delimiter
from the actual content and also makes it easier
to spot mismatching delimiters.

M  +25   -25   autotests/folding/highlight.cpp.fold
M  +9    -9    autotests/html/highlight.cpp.dark.html
M  +9    -9    autotests/html/highlight.cpp.html
M  +2    -2    autotests/input/highlight.cpp
M  +9    -9    autotests/reference/highlight.cpp.ref
M  +12   -10   data/syntax/isocpp.xml

https://invent.kde.org/frameworks/syntax-highlighting/commit/61b6d9d1198a55a4dbc629b49f289c9604fdbcfb