Broken Code Highlighting in KDevelop

Milian Wolff mail at milianw.de
Thu Feb 18 14:28:52 GMT 2021


On Mittwoch, 17. Februar 2021 09:40:01 CET David Redondo wrote:
> Hi,
> 
> recently files began to start losing their highlighting when editing in
> KDevelop. Symptoms are as follows:
>  - After inserting a new line anywhere in a document, everything below the
> new line will lose its highlighting
>  - When writing in the new line, the new code is highlighted correctly
>  - Removing the new line restores correct highlighting in the rest of the
> file
> 
> Yesterday after an older KDevelop showed the same behavior, I bisected
> fde333c87353e7c7424c7bce5cbc2f984bc868c1 in KTextEditor to have introduced
> this. Nothing there immediately appears to me to cause this.
> With the power of debug statements I confirmed that KDevelop reaches the
> "applyHighlighting" function
> (https://invent.kde.org/kdevelop/kdevelop/-/blob/
> master/kdevplatform/language/highlighting/codehighlighting.cpp#L519) and is
> not hitting any of the early returns. Then follows some range logic and I
> did see that the setAttribute calls at the end are also happening.
> 
> I'm not sure if the KTextEditor change surfaced a bug in KDevelop (somewhere
> in the range manipulation?) or if something in KTextEditor is not working
> correctly.

Hey David,

I believe I've also seen this yesterday, but it is not easy to reproduce, is 
it? If you find a way to reproduce, then let me know - I could look into that.

Cheers

-- 
Milian Wolff
mail at milianw.de
http://milianw.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kwrite-devel/attachments/20210218/8275154e/attachment.sig>


More information about the KWrite-Devel mailing list