Discuss syntax highlighting or submit new syntax files.
iorx
Posts: 4 Joined: 30 Jun 2008 13:41
Post
by iorx » 30 Jun 2008 13:49
Hello!
First post. Very nice editor you've made!
I've fooling around with syx-files. Managed to make folding work on Batch-files if (), do (). Now I struggling with folding on ini, and inf.
The folding should be done from "[" to next "[" (or \n ? for last section...) I've figured. But can't get it working. Any suggestions?
-------------------
[section]
foo=bar
foo=bar
foo=bar
[section]
foo=bar
foo=bar
foo=bar
-------------------
Brgs,
Iorx
Rickard Johansson
Site Admin
Posts: 6799 Joined: 19 Jul 2006 14:29
Post
by Rickard Johansson » 30 Jun 2008 15:44
You could use regions.
In the syntax file:
Code: Select all
Rgn_Start = "$START"
Rgn_End = "$END"
Rgn_CommentStart = ";"
In code write:
Code: Select all
;$START "This is section 1"
[section]
foo=bar
foo=bar
;$END
;$START "This is section 2"
[section]
foo=bar
foo=bar
;$END
iorx
Posts: 4 Joined: 30 Jun 2008 13:41
Post
by iorx » 30 Jun 2008 20:45
[quote="Rickard Johansson"]You could use regions.
In the syntax file:
Code: Select all
Rgn_Start = "$START"
Rgn_End = "$END"
Rgn_CommentStart = ";"
I was more in for the solution that NP++ has. Like this, a .reg file.
Possible to parse for an empty line?
Rickard Johansson
Site Admin
Posts: 6799 Joined: 19 Jul 2006 14:29
Post
by Rickard Johansson » 01 Jul 2008 10:07
I'll see what I can do. We could enable the use of a wildcard (*) and maybe use something like:
Id=[*]
End=
Notice the empty option value (End=). This would create a foldable block at the first empty line.
I have desided to release a version 4.51. I'll add some small features and fix a few small issues. I'll try to make this work in this version.
Rickard Johansson
Site Admin
Posts: 6799 Joined: 19 Jul 2006 14:29
Post
by Rickard Johansson » 08 Jul 2008 11:01
I think a better solution would be to add an option to fold by indent (like Notepad++). This could be set in the syntax file and used with files like .boo, .ini, .reg...
It will also check for the next keyword (block...) if the text have the same indention.
E.g.
[keyword]
text=bla
text=bla
[keyword]
[keyword]
text=bla
And if we have two keyword after another, we can skip the first. I think this is how the Scintilla editor component (in Notepad++) does it. This option will also disable normal folding (by syntax elements).
It will require some work to implement. It'll have to wait til v4.60.