Recent

Author Topic: custom %REGION hide like in Delphi;  (Read 3993 times)

guest62577

  • Guest
custom %REGION hide like in Delphi;
« on: July 26, 2018, 09:52:55 pm »
when using custom region at the editor, seem from Delphi it suffers in organization design("valuable space");

current situation
region keyword are present on the code when folded
Code: Pascal  [Select][+][-]
  1. {%REGION}
  2.   // some code, unfolded
  3. {%ENDREGION}
  4.  
  5. {%REGION} [...]   //folded code remain region keyword

Code: Pascal  [Select][+][-]
  1. {%REGION /fold}
  2.   // some code, unfolded
  3. {%ENDREGION}
  4.  
  5. {%REGION /fold} [...]   //folded code remain region keyword

Code: Pascal  [Select][+][-]
  1. {%REGION /fold ' region title '}
  2.   // some code, unfolded
  3. {%ENDREGION}
  4.  
  5. {%REGION /fold ' region title' } [...]   //folded code remain region keyword

wondering situation
region keyword are hidden when folded; like in Delphi;
Code: Pascal  [Select][+][-]
  1. {%REGION}
  2.   // some code, unfolded
  3. {%ENDREGION}
  4.  
  5. [...]   //folded code no region keyword

Code: Pascal  [Select][+][-]
  1. {%REGION /fold}
  2.   // some code, unfolded
  3. {%ENDREGION}
  4.  
  5. [...]   //folded code no region keyword

Code: Pascal  [Select][+][-]
  1. {%REGION /fold ' region title '}
  2.   // some code, unfolded
  3. {%ENDREGION}
  4.  
  5. {' region title' } [...]   //folded code no region keyword

how to hide the Region and /fold keyword when code is folded?

thanks;

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9874
  • Debugger - SynEdit - and more
    • wiki
Re: custom %REGION hide like in Delphi;
« Reply #1 on: July 26, 2018, 10:30:17 pm »
I dont know if it works with the /fold indicator.
But you can go to Tools > Options > Editor > Code folding, and select region in the list, then from the radio-buttons choose "hide"

hide, however will leave no line at all. the [...] are shown in the line above.

region title is not implemented yet
« Last Edit: July 26, 2018, 10:32:22 pm by Martin_fr »

guest62577

  • Guest
[SOLVED] custom %REGION hide like in Delphi;
« Reply #2 on: July 26, 2018, 10:50:22 pm »
with this setting, it actually works like in Delphi;

Sample Usage [SOLVED]
using the settings instructions indicated by Martin_fr
Code: Pascal  [Select][+][-]
  1. {Region Title}
  2. {%REGION /fold}
  3.   // some code, unfolded
  4. {%ENDREGION}
  5.  
  6. {Region Title} [...]   //folded code no region keyword

thanks;

guest62577

  • Guest
<ISSUE> custom %REGION hide like in Delphi;
« Reply #3 on: July 27, 2018, 01:47:06 am »
as a side note to the sample solution presented, which works by functionally;
it would still fail by Design on that now everything is at the same comment color;

meaning User Defined Markup are not saved in the Project Options, creating a different "work" that would consist exporting(backup\save) Editor Options in order to retain customized the "Region Titles" [...]

the custom color used by %Region are the IDE Directive under Options > Editor > Display > Colors

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: <ISSUE> custom %REGION hide like in Delphi;
« Reply #4 on: July 27, 2018, 02:02:28 am »
as a side note to the sample solution presented, which works by functionally;
it would still fail by Design on that now everything is at the same comment color;

meaning User Defined Markup are not saved in the Project Options, creating a different "work" that would consist exporting(backup\save) Editor Options in order to retain customized the "Region Titles" [...]

the custom color used by %Region are the IDE Directive under Options > Editor > Display > Colors
you can use the {$Region } as well like in delphi.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

 

TinyPortal © 2005-2018