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
Fold ini and inf files
- Rickard Johansson
- Site Admin
- Posts: 6646
- Joined: 19 Jul 2006 14:29
You could use regions.
In the syntax file:
In code write:
In the syntax file:
Code: Select all
Rgn_Start = "$START"
Rgn_End = "$END"
Rgn_CommentStart = ";"
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
[quote="Rickard Johansson"]You could use regions.
In the syntax file:
I was more in for the solution that NP++ has. Like this, a .reg file.
Possible to parse for an empty line?
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: 6646
- Joined: 19 Jul 2006 14:29
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.
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: 6646
- Joined: 19 Jul 2006 14:29
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.
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.