Quote Originally Posted by Usability View Post
I am having trouble writing the syntax file for a language that uses begin/end as the block start/end delimiters, like { and } in C.
This should work AFAIK :
Qt Code:
  1. <word format="keyword" parenthesis="be_block:open" indent="1" fold="1">begin</word>
  2. <word format="keyword" parenthesis="be_block:close" indent="1" fold="1">end</word>
To copy to clipboard, switch view to plain text mode 

Quote Originally Posted by Usability View Post
A couple of related but somewhat pedantic questions. There seem to be some gremlins exposed by having begin and end markers on the same line. Try running the example editor, eg

example/example

And enter this:

Qt Code:
  1. if (1) {;} else {
  2.  
  3.  
  4. }
  5. if {
  6.  
  7.  
  8. }
To copy to clipboard, switch view to plain text mode 

then collapse the fold starting on the if. For me this produces a corrupt screen showing three if lines. I appreciate that is an ugly example, and I wont be at all surprised if you choose to ignore it.
I'll look into it. I can't ignore such a bug if I want the syntax engine to trully be generic...

Quote Originally Posted by Usability View Post
This one is a more reasonable code style.

Qt Code:
  1. if (1) {
  2.  
  3.  
  4. } else {
  5.  
  6.  
  7. }
To copy to clipboard, switch view to plain text mode 

Here if you fold up the if statement it folds the complete program. I am not sure this is correct. I was expecting the else branch to remain expanded.
This is correct... As I can place more than one collapse/fold marker per line I decided to fold "whole" blocks... I can try to change that behavior (and possibly make it configurable) but I'm not sure it would be worth the effort. (correct me if I'm wrong).