In emacs' cperl-mode, lines that continute a statement from a previous line are indented by one level:
my $var
= (1+1)
* (2+2)
/ (3+3);
However, if the statement does not begin at zero indentation because it is inside a block, then if you break your statement onto a third line, you get another level of indentation, and so on:
sub break_my_indentation {
my $var
= (1+1)
* (2+2)
/ (3+3);
return "Indentation is broken.";
}
Is there any way to fix this so that statements are indented the same way inside blocks as they are outside? I would like the second example to look like this:
sub fix_my_indentation {
my $var
= (1+1)
* (2+2)
/ (3+3);
return "Indentation is fixed.";
}
I confirm that the behavior you describe is present, but, from reading the sources and running under the debugger, it is not obvious that there is a customization which gets you the behavior you (and I) want.
Therefore I think this is a bug in
cperl-mode
.The fix is:
Please test this patch; if you are happy with it, I will add a customization to enable it.