Allow line end context switches in empty lines
ClosedPublic

Authored by nibags on Mar 31 2019, 7:42 PM.

Details

Summary

BUG: 405903

Bug: Don't skip empty lines after matching a LineContinue rule:

When you write an empty line after a line continuation character, the empty lines are ignored.
This generates an incorrect highlight, since it includes within the context multiple lines after a line continuation character, when the respective context has lineEndContext="#pop".

The problem is caused because the lineEndContext attribute doesn't work in empty lines. Now lineEndContext works in empty lines, but only if lineEmptyContext is #stay.

Diff Detail

Repository
R216 Syntax Highlighting
Branch
fix-line-continue
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 10357
Build 10375: arc lint + arc unit
nibags created this revision.Mar 31 2019, 7:42 PM
Restricted Application added projects: Kate, Frameworks. · View Herald TranscriptMar 31 2019, 7:42 PM
Restricted Application added subscribers: kde-frameworks-devel, kwrite-devel. · View Herald Transcript
nibags requested review of this revision.Mar 31 2019, 7:42 PM
nibags updated this revision to Diff 55161.Apr 1 2019, 4:10 AM
  • Don't store bool in StateData
nibags retitled this revision from Don't skip empty lines after matching a LineContinue rule to Allow line end context switches in empty lines.Apr 1 2019, 4:15 AM
nibags edited the summary of this revision. (Show Details)

The change in the results look reasonable.
For the loop itself: Should one not combine both loops?
e.g. loop as long as either the emptycontext is stay and one does switch at line end or the emptycontext doesn't stay?
Then one can handle intermixed things.

nibags updated this revision to Diff 55253.Apr 2 2019, 4:21 AM
  • Loop proposal

I propose this combination of loops. Any detail don't hesitate to say (or commit)!

cullmann accepted this revision.Apr 2 2019, 5:06 AM

Ok for me, thanks!

This revision is now accepted and ready to land.Apr 2 2019, 5:06 AM
nibags closed this revision.Apr 2 2019, 5:21 AM