# Perltidy Change Log
- Added parameter --non-indenting-braces, or -nib, which prevents
- code following an opening brace marked with a special side comment
- from indenting one level. This is off by default and turned on
- with -nib. It might be useful for preventing code from shifting
- when adding or testing closures, for example.
+ code which follows an opening brace marked with a special side comment,
+ '#<<<', from indenting one level. For example,
+
+ { #<<< a closure to contain lexical vars
+
+ my $var; # this line does not indent
+
+ }
+
+ # this line cannot 'see' $var;
+
+ This is on by default. If your code happens to have some
+ opening braces followed by '#<<<', and you
+ don't want this, you can use -nnib to deactivate it.
- Side comment locations reset at a line ending in a level 0 open
block, such as when a new multi-line sub begins. This is intended to
=item B<-nib>, B<--non-indenting-braces>
-If this flag is set, perltidy will look for opening block braces which are
-followed by a special side comment, which is B<#<<<> by default. If found, the
-code between this opening brace and its corresponding closing brace will not be
-given the normal extra indentation level. As a simple example,
+Normally, lines of code contained within a pair of block braces receive one
+extra level of indentation. If this flag is set, perltidy will look for
+opening block braces which are followed by a special side comment, which is
+B<#<<<> by default. If found, the code between this opening brace and its
+corresponding closing brace will not be given the normal extra indentation
+level. For example:
- perltidy -nib:
+ { #<<< a closure to contain lexical vars
- { #<<<
- print "hello world\n";
- }
+ my $var; # this line does not get one level of indentation
+ ...
+
+ }
+
+ # this line cannot 'see' $var;
+
+This can be useful, for example, when combining code from different files.
+Different sections of code can be placed within braces to keep their lexical
+variables from being visible to the end of the file. To keep the new blocks
+from causing all of their contained code to be reformatted if you run perltidy,
+you can mark the opening braces with this special side comment.
+
+Only the opening brace needs to be marked, since perltidy knows where the
+closing brace is.
-This might be useful, for example, to keep large sections of code from
-moving to the right when placed in a closure.
+This feature is on by default. If your code happens to have some opening
+braces followed by '#<<<', and you don't want this, you can use B<-nnib> to
+deactivate it. To make it easy to remember, the default string is the same as
+the string for starting a B<format-skipping> section. There is no confusion
+because in that case it is for a block comment rather than a side-comment.
-Only the opening brace needs to be marked, and nested braces can be marked.
-The special side comment can be changed with the next parameter.
+The special side comment can be changed with the next
+parameter.
=item B<-nibp=s>, B<--non-indenting-brace-prefix=s>
-nibp='#\+\+'
-Note that the default string is the same as the string for starting a
-B<format-skipping> section, but in that case it is for a block comment
-rather than a side-comment.
=item B<-olq>, B<--outdent-long-quotes>
../snippets21.t git33.git33
../snippets21.t rt133130.def
../snippets21.t rt133130.rt133130
+../snippets21.t nib.def
+../snippets21.t nib.nib1
+../snippets21.t nib.nib2
../snippets3.t ce_wn1.ce_wn
../snippets3.t ce_wn1.def
../snippets3.t colin.colin
../snippets9.t rt98902.def
../snippets9.t rt98902.rt98902
../snippets9.t rt99961.def
-../snippets21.t nib.def
-../snippets21.t nib.nib1
-../snippets21.t nib.nib2