How to costom keywords and not to fold?

Discuss any topics about the editor here

How to costom keywords and not to fold?

Postby pinotory » Sat Dec 14, 2013 10:53 am

Hello. I want to ask how to custom folding system.
I use Editra as a Fortran 2008 Editor, so I'm talking about 'Fortran 95' Lexer.

Whan you write 'module procedure', Editra try to fold maybe because this keyword contains folding keyword 'module'.
But 'module procedure' is just a simple keyword as 'integer,' and it can't fold since this has no pair closing keyword.
So I want to add 'module procedure' as a simple keyword and remain 'module' as a folding keyword with 'end module'.
How can I make it? My edxml file might have bug but I can't break this.
Especially, how can I connect 2 words as 1 keyword?

Please help me.
Thank you.

<editra version="1">
<syntax language="Fortran" lexer="STC_LEX_FORTRAN" id="ID_LANG_MyFortran">
<associations value="f90"/>
<keywordlist>
<keywords value="0">
module procedure
</keywords>
</keywordlist>
<syntaxspeclist>
<syntaxspec value="STC_F_IDENTIFIER" tag="keyword4_style"/>
</syntaxspeclist>
<propertylist>
<property value="fold" enable="0"/>
</propertylist>
<commentpattern value="//"/> !? Is this line needed?
</syntax>
</editra>
pinotory
 

Re: How to costom keywords and not to fold?

Postby cody » Mon Dec 16, 2013 6:13 pm

Unfortunately the folding can only be configured to be either turned on or off when using a built-in lexer. You can do this from the user configuration dialog if you want to turn folding off completely.

Outside of this the folding behavior is out of Editra's control. It comes from the StyledTextCtrl provided by wxPython. Would need to see if the newer versions of wxPython have an update that fixes this specific issue or you would need to code your own custom lexer that provides folding for Fortran.
User avatar
cody
Site Admin
 
Posts: 1315
Joined: Mon Oct 09, 2006 2:49 am
Location: United States


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron