In syntax files for katepart, pushing N contexts on the context stack and "#pop"ing N times will normally get us back to the same context. However, if "the same context" is a continuation of the previous line due to LineContinue, it pops N+1 times. That is one too many. Reproducible: Always Steps to Reproduce: I will attach a syntax file, a testcase and a screenshot to prove my "Actual Results". You can verify by: 1) Copy the syntax file into /usr/share/kde4/apps/katepart/syntax/ 2) Open the testcase in Kwrite. Actual Results: 1) LineContinue evidently succeeds in continuing the context of the previous line. 2) Pushing and popping equally many times returns to the _same context_ when not using LineContinue. 3) Pushing and popping equally many times returns to the _parent context_ after encountering LineContinue. Expected Results: LineContinue should not alter the state machine. It seems impossible to write a syntax file for a language that has substates in a state that uses line continuations. Therefore, I think a major feature is broken. The current behaviour is in my opinion neither logical or useful. It certainly cannot be relied on (any more than the presence of line continuations).
Created attachment 71088 [details] syntax file for a testcase to demonstrate bogus LineContinue
Created attachment 71089 [details] testcase to demonstrate bogus LineContinue
Created attachment 71090 [details] screenshot of testcase demonstrating bogus LineContinue If it was possible to upload attachments when submitting the report, a lot less emails would need to be sent…
Git commit 5bff64eb8f040ffa1ce48545dbfaf23eab04a13c by Christoph Cullmann. Committed on 24/10/2012 at 19:27. Pushed by cullmann into branch 'master'. fix typo that killed line continue behavior this fixes that line continue messes with the highlighting stack now it is "transparent" to the context stack M +1 -5 part/syntax/katehighlight.cpp http://commits.kde.org/kate/5bff64eb8f040ffa1ce48545dbfaf23eab04a13c
Thanks a lot for the perfect example to reproduce and fix! Was just a copy and paste error it seems, stupid :(
*** Bug 308957 has been marked as a duplicate of this bug. ***