UDL2.0 - testing phase
  • Home
  • Introduction
  • Default
  • Folding in code
  • Folding in comment
  • Operators
  • Numbers
  • Keywords
  • Comments
  • Delimiters
  • Numbers new


Folding in code is quite different in UDL 2.0.
Instead of two keyword sets (open and close), now we have three keyword sets (open, middle and close).
Also, there are two Folding in code  groups: one for forward (style1) and one for backward (style2)  search. 

Picture



This is a typical C++ folding definition.
Curly braces represent folding points in the code and preprocessor is also supported (for this demo not all statements were defined)


Example 1:
Picture

There are two important things here.
As you can see both Folding 1 and Folding 2 create folding points, but they work differently.

  • Folding 1 (the curly braces) is detected using forward search. It means these keywords can be "glued" to some other keyword. In this case opening curly brace stands next to closing round brace, and in line 12 around word "int"
  • Folding 2 (preprocessor stuff) works when surrounded by white space, but not when glued to word "UNICODE", as demonstrated in line 14



Note that: forward and backward search concept is explained in more detail in Introduction tab. 
You should read that part if you haven't already.

Example 2:

Picture


UDL 2.0 will automatically create middle folding point if open folding point is followed by a close folding point on the same line.



Example 2:
Picture
Picture

Use of multi-part keywords is supported in Folder in code 2, as you can see in this example.

But there might not always work (see example 3)


Example 3:     EDIT: this should be fixed in Beta 1 !!

Picture
Picture

If I define both "else if" and "else" as keywords, folding breaks.
This happens because scintilla re-aranges keywords in alphabetical order, and "else" gets processed before "else if".

 UDL 2.0 will go into testing with this limitation.

    Comments

Submit
Powered by Create your own unique website with customizable templates.