1

Company i work develops a new programming language which will ease job of engineer. My job is to supply this language with a nice editor which is also involves code folding. I need to have custom code folding which is not include "{" and "}". I am working with Geany filetypes. I add new filetype. I want to fold some structure like below.

 if %condition%  then                     for each %element% in  %range%  do 
    %statement%                              %statement%  
 else if %condition%  then                end for
    %statement%  
 else
 end if

I know my language far from c type , however add such line to my code for enabling syntax coloring.

  [settings]
  lexer_filetype=C

Any kind of help will be appreciated.

4

2 回答 2

0

I dont know exact answer but i know how i can dig it up. As far there is no an answer i am going to write how can the answer can be appeared. Using scintilla and its lexers can take us to solution of this problem. Both Geany and Scintilla documentations mention about support of that feature.

于 2015-07-03T10:22:25.097 回答
-1

Under Debian :

  1. cp /usr/share/geany/filetypes.c ~/.config/geany/filedefs/

  2. chown myUser:myGroup ~/.config/geany/filedefs/filetypes.c

  3. Edit the file. Under the section [lexer_properties] add the line:

    fold.cpp.comment.explicit=1

  4. Save the file.

  5. Open geany. You are now able to put userfoldings using the default //{ and //} delimiters in c and in cpp. These do not influence your code because to c and cpp it are comments.

于 2015-10-29T11:28:12.560 回答