Board logo

Subject: Surround with begin..end [Print This Page]

Author: gramer    Time: 2009-7-12 08:27     Subject: Surround with begin..end

Hello, surround with begin..end (Alt + Shift + B) is great feature to use, but I found that it is not working right for me in case
there are some of operators like for.., if.., etc before the line I'm trying to surround with begin..end

For example, I have code like

[Copy to clipboard]
CODE:
if Condition then
  Something;

I need to add additional line

[Copy to clipboard]
CODE:
if Condition then
begin
  Something;
  SomethingMore;
end;

But when I select Something and hit Alt + Shift + B, I get

[Copy to clipboard]
CODE:
if Condition then
  begin
    Something;
  end;

Is there any way to make this tool to distinguish operators like if.., for.., with.. etc and do not shift begin..end construction to the right for them?

For now I've put -1 relative indent in the options since I use this feature with if.. code, but this way it doesn't work with plain code
Author: Passion    Time: 2009-7-29 09:59

Yes. Reasonable. if begin..end (or {} in C++), it should be auto align with previous line.

We'll add this enhancement in next nightly build version.




Welcome to CnPack Forum (http://bbs.cnpack.org/) Powered by Discuz! 5.0.0