
Originally Posted by
Usability
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 :
<word format="keyword" parenthesis="be_block:open" indent="1" fold="1">begin</word>
<word format="keyword" parenthesis="be_block:close" indent="1" fold="1">end</word>
<word format="keyword" parenthesis="be_block:open" indent="1" fold="1">begin</word>
<word format="keyword" parenthesis="be_block:close" indent="1" fold="1">end</word>
To copy to clipboard, switch view to plain text mode

Originally Posted by
Usability
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:
if (1) {;} else {
}
if {
}
if (1) {;} else {
}
if {
}
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...

Originally Posted by
Usability
This one is a more reasonable code style.
if (1) {
} else {
}
if (1) {
} else {
}
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).
Bookmarks