Subject: KSyntaxHighlighting is cool! Happy: :-) Sad: :-( Subject goes on here > < ] [
From: Volker Krause <[email-masked]>
To: [email-masked]
Cc: <[email-masked]>, "Giant; \"Big\" Box" <[email-masked]> (CC example from RFC 5322 Appendix A.1.2)
Date: Wed, 05 Oct 2016 22:19:17 +0200
List-Id: Kate/KWrite Mailing List <kwrite-devel.kde.org>

Hi,

when trying to add the unit test for the new Praat highlighting to
KF5::SyntaxHighlighting it turned out that the output doesn't match at all
that of Kate. We managed to trace this back to the following rather surprising
(and apparently undocumented) behavior in Kate:

When a context switch (anywhere in a line) pops more contexts than were on the
stack when starting the line, it executes line end context switches of the
previous line contexts.

| | | | | | The corresponding code is in KateHighlighting::generateContextStack(),
| | > | > KF5::SyntaxHighlighting doesn't do this (yet), Praat is apparently the first
> | > format we have tests for that uses this behavior.

> Does anyone remember why we do this, or happens to know which highlighting
> files besides Praat rely on this?

> > Archeology can trace this back to the dark CVS ages even, one reference
> > Dominik has dug up is a 10 year old SVN commit
> > (https://quickgit.kde.org/?p=kdelibs.git&a=commit&h=90ef47f582277745f727d89f05f72f1e1705fdc4
> >), where Christoph claims to understand what this code does ;)

> > > As this is highly unexpected and hard to reason about behavior, Dominik and I
> > > > were wondering if we can possibly drop this, and rather fix affected
> > > > > highlighting files instead?

Regards,
Volker