Recent

Author Topic: {%region -fold} not work  (Read 2844 times)

x2nie

  • Hero Member
  • *****
  • Posts: 515
  • Impossible=I don't know the way
    • impossible is nothing - www.x2nie.com
{%region -fold} not work
« on: January 01, 2016, 12:18:28 pm »
I dropped a synedit and  pascal HL in a form.
Everything goes OK, except the autocollapse ( -fold} ) doesn't work.


Am I need to configure something else?
I am using Lazarus 1.6 and trunk. both seem similar as wrong (not being collapsed, should be collapsed)

This is my lines in synedit :
Code: Pascal  [Select][+][-]
  1. program foo;
  2.  
  3. {%region 'Trial procedures' -fold}
  4.  
  5. procedure bar();
  6. begin
  7. end;  
  8.  
  9.  
  10. {%endregion}
  11. BEGIN
  12. END.
« Last Edit: January 01, 2016, 12:21:09 pm by x2nie »
When you were logged in, you can see attachments.
Lazarus Github @ UbuntuCinnamon-v22.04.1 + LinuxMintDebianEdition5

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9911
  • Debugger - SynEdit - and more
    • wiki
Re: {%region -fold} not work
« Reply #1 on: January 01, 2016, 01:14:34 pm »
I need to check, maybe there is some method that needs to be called "applyFoldState" or the  like

x2nie

  • Hero Member
  • *****
  • Posts: 515
  • Impossible=I don't know the way
    • impossible is nothing - www.x2nie.com
Re: {%region -fold} not work
« Reply #2 on: January 01, 2016, 01:17:13 pm »
yes, most probably a procedure need to be called.

 because in the same time, the same code is auto collapsed when opened in Lazarus IDE editor.
When you were logged in, you can see attachments.
Lazarus Github @ UbuntuCinnamon-v22.04.1 + LinuxMintDebianEdition5

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9911
  • Debugger - SynEdit - and more
    • wiki
Re: {%region -fold} not work
« Reply #3 on: January 01, 2016, 01:20:37 pm »
it is probably the same method, that is used to load/apply the foldstate  (saved folds)

x2nie

  • Hero Member
  • *****
  • Posts: 515
  • Impossible=I don't know the way
    • impossible is nothing - www.x2nie.com
Re: {%region -fold} not work
« Reply #4 on: January 01, 2016, 01:38:01 pm »
I found it.


After setting highlighter, load the file, then I need to call:


Code: Pascal  [Select][+][-]
  1. SynFreePascalSyn1.AfterLoadFromFile();
It's do the trick 8)
When you were logged in, you can see attachments.
Lazarus Github @ UbuntuCinnamon-v22.04.1 + LinuxMintDebianEdition5

 

TinyPortal © 2005-2018