Fix endRegion folding in rules with beginRegion+endRegion (use length=0)
ClosedPublic

Authored by nibags on Mar 23 2019, 2:22 PM.

Details

Summary

BUG: 405585

There is a problem of folding in rules with beginRegion + endRegion.

Example:

<StringDetect String="hello" endRegion="region1" beginRegion="region2" />

In this case, the "hello" string is part of the "region1" and "region2" regions simultaneously, which generates folding problems. The ideal behavior is that "hello" isn't part of "region1", but of "region2". That is, don't publish length of endRegion folding in rules with beginRegion+endRegion.

For example, in .desktop files:

The following XML files use rules with beginRegion + endRegion:

  • ansforth94.xml
  • apparmor.xml
  • asciidoc.xml
  • asp.xml c.xml
  • cisco.xml
  • desktop.xml
  • fortran.xml
  • haml.xml
  • ini.xml
  • isocpp.xml
  • julia.xml
  • lex.xml
  • lua.xml
  • makefile.xml
  • perl.xml
  • pony.xml
  • rhtml.xml
  • rpmspec.xml
  • ruby.xml
  • template-toolkit.xml
  • txt2tags.xml
  • yacc.xml

Diff Detail

Repository
R216 Syntax Highlighting
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
nibags created this revision.Mar 23 2019, 2:22 PM
Restricted Application added projects: Kate, Frameworks. · View Herald TranscriptMar 23 2019, 2:22 PM
Restricted Application added subscribers: kde-frameworks-devel, kwrite-devel. · View Herald Transcript
nibags requested review of this revision.Mar 23 2019, 2:22 PM
nibags edited the summary of this revision. (Show Details)Mar 23 2019, 2:39 PM

Looks good to me. Anyone else?

cullmann accepted this revision.Mar 24 2019, 1:06 PM

I think this is a reasonable change!
Thanks.

This revision is now accepted and ready to land.Mar 24 2019, 1:06 PM
This revision was automatically updated to reflect the committed changes.